From: Cristy Date: Tue, 1 May 2018 23:13:17 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/1119 X-Git-Tag: 7.0.7-30~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fd58ce46f4a731043e5b7ccf81400d5f60f9a35;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1119 --- diff --git a/coders/png.c b/coders/png.c index f70eed4ec..55f1734d0 100644 --- a/coders/png.c +++ b/coders/png.c @@ -4732,7 +4732,7 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Copying JDAT chunk data to color_blob."); - if (length != 0) + if ((length != 0) && (color_image != (Image *) NULL)) { (void) WriteBlob(color_image,length,chunk); chunk=(unsigned char *) RelinquishMagickMemory(chunk);