From: Cristy Date: Wed, 28 Dec 2016 00:15:56 +0000 (-0500) Subject: Don't throw an exception if the image histogram has no colors X-Git-Tag: 7.0.4-1~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acfe438d8aa63fd8c2f59b1296ecaf001bd337de;p=imagemagick Don't throw an exception if the image histogram has no colors --- diff --git a/MagickCore/histogram.c b/MagickCore/histogram.c index ab2cbcf1a..04c56eca0 100644 --- a/MagickCore/histogram.c +++ b/MagickCore/histogram.c @@ -533,7 +533,7 @@ MagickExport PixelInfo *GetImageHistogram(const Image *image, cube_info=ClassifyImageColors(image,exception); if (cube_info != (CubeInfo *) NULL) { - histogram=(PixelInfo *) AcquireQuantumMemory((size_t) cube_info->colors, + histogram=(PixelInfo *) AcquireQuantumMemory((size_t) cube_info->colors+1, sizeof(*histogram)); if (histogram == (PixelInfo *) NULL) (void) ThrowMagickException(exception,GetMagickModule(),