From 6e9a6c7577313571ec41f4ed15f306b8b3bebf7a Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 4 Mar 2018 10:00:40 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6727 --- MagickCore/statistic.c | 13 +++++-------- configure | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index 3fc4f07af..bf81e58e3 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -2110,14 +2110,11 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, count; count=area*histogram[GetPixelChannels(image)*j+i]; - if (number_bins > MagickEpsilon) - { - channel_statistics[channel].entropy+=-count*MagickLog10(count)/ - MagickLog10(number_bins); - channel_statistics[CompositePixelChannel].entropy+=-count* - MagickLog10(count)/MagickLog10(number_bins)/ - GetPixelChannels(image); - } + channel_statistics[channel].entropy+=-count*MagickLog10(count)* + PerceptibleReciprocal(MagickLog10(number_bins)); + channel_statistics[CompositePixelChannel].entropy+=-count* + MagickLog10(count)*PerceptibleReciprocal(MagickLog10(number_bins))/ + GetPixelChannels(image); } } histogram=(double *) RelinquishMagickMemory(histogram); diff --git a/configure b/configure index be58cb563..31f3dc8c0 100755 --- a/configure +++ b/configure @@ -4550,7 +4550,7 @@ MAGICK_PATCHLEVEL_VERSION=25 MAGICK_VERSION=7.0.7-25 -MAGICK_GIT_REVISION=23162:29064ef33:20180303 +MAGICK_GIT_REVISION=23178:009e5556d:20180304 # Substitute library versioning -- 2.40.0