]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Fri, 1 Jun 2018 22:26:05 +0000 (18:26 -0400)
committerCristy <urban-warrior@imagemagick.org>
Fri, 1 Jun 2018 22:26:05 +0000 (18:26 -0400)
coders/png.c

index cc9693fa4114bc87ba96c9faf55d09dc19828092..8b78bdf7c7695d68575838648e0e458e5df6cdfe 100644 (file)
@@ -4970,13 +4970,15 @@ static Image *ReadOneJNGImage(MngInfo *mng_info,
     {
       assert(color_image == (Image *) NULL);
       assert(alpha_image == (Image *) NULL);
+      if (color_image != (Image *) NULL)
+        color_image=DestroyImageList(color_image);
       return(DestroyImageList(image));
     }
 
   if (color_image == (Image *) NULL)
     {
       assert(alpha_image == (Image *) NULL);
-      return(DestroyImageList(image));
+      ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
     }
 
   (void) SeekBlob(color_image,0,SEEK_SET);