From: Cristy Date: Sun, 4 Mar 2018 15:00:40 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6727 X-Git-Tag: 7.0.7-26~98 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e9a6c7577313571ec41f4ed15f306b8b3bebf7a;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6727 --- 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