From: Cristy Date: Sat, 10 Mar 2018 21:27:32 +0000 (-0500) Subject: ... X-Git-Tag: 7.0.7-26~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89af9a2c5a857edc00abf6af1bf652200fcb3412;p=imagemagick ... --- diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 05b281e7a..164b7faa5 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -1589,10 +1589,11 @@ MagickExport MagickBooleanType EqualizeImage(Image *image, double intensity; - intensity=p[i]; + intensity=(double) p[i]; if ((image->channel_mask & SyncChannels) != 0) intensity=GetPixelIntensity(image,p); - histogram[GetPixelChannels(image)*ScaleQuantumToMap(intensity)+i]++; + histogram[GetPixelChannels(image)*ScaleQuantumToMap( + ClampToQuantum(intensity))+i]++; } p+=GetPixelChannels(image); }