]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1119
authorCristy <urban-warrior@imagemagick.org>
Tue, 1 May 2018 23:13:17 +0000 (19:13 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 1 May 2018 23:13:17 +0000 (19:13 -0400)
coders/png.c

index f70eed4ec51e9c40c04a8ab9e9ab54df9ac753b9..55f1734d0f61e863f7def5e653294458edaa84cb 100644 (file)
@@ -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);