From: Cristy Date: Mon, 13 Feb 2017 02:12:24 +0000 (-0500) Subject: ... X-Git-Tag: 7.0.4-8~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=76423844ed024178f3a69f2437fc6df64cdf06e5;p=imagemagick ... --- diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index 4f17d759e..c665295ec 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -1907,7 +1907,7 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - histogram=(double *) AcquireQuantumMemory(MaxMap+1UL,(MaxPixelChannels+1)* + histogram=(double *) AcquireQuantumMemory(MaxMap+1UL,GetPixelChannels(image)* sizeof(*histogram)); channel_statistics=(ChannelStatistics *) AcquireQuantumMemory( MaxPixelChannels+1,sizeof(*channel_statistics)); @@ -1929,7 +1929,7 @@ MagickExport ChannelStatistics *GetImageStatistics(const Image *image, channel_statistics[i].maxima=(-MagickMaximumValue); channel_statistics[i].minima=MagickMaximumValue; } - (void) ResetMagickMemory(histogram,0,(MaxMap+1)*(MaxPixelChannels+1)* + (void) ResetMagickMemory(histogram,0,(MaxMap+1)*GetPixelChannels(image)* sizeof(*histogram)); for (y=0; y < (ssize_t) image->rows; y++) {