From: Cristy Date: Tue, 19 Dec 2017 18:59:24 +0000 (-0500) Subject: https://github.com/ImageMagick/ImageMagick/issues/902 X-Git-Tag: 7.0.7-16~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d6accd355119d54429a86a1859b8329f0130f30;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/902 --- diff --git a/coders/png.c b/coders/png.c index caef8e017..1c691c66e 100644 --- a/coders/png.c +++ b/coders/png.c @@ -9250,10 +9250,12 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, image->colors = image_colors; - if (AcquireImageColormap(image,image_colors,exception) == - MagickFalse) - ThrowWriterException(ResourceLimitError, - "MemoryAllocationFailed"); + if (AcquireImageColormap(image,image_colors,exception) == MagickFalse) + { + (void) ThrowMagickException(exception,GetMagickModule(), + ResourceLimitError,"MemoryAllocationFailed","`%s'", + IMimage->filename); + } for (i=0; i< (ssize_t) image_colors; i++) image->colormap[i] = colormap[i];