]> granicus.if.org Git - imagemagick/commitdiff
Don't destroy a NULL "previous" image in the PNG decoder.
authorglennrp <glennrp@git.imagemagick.org>
Tue, 25 Nov 2014 00:46:19 +0000 (00:46 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Tue, 25 Nov 2014 00:46:19 +0000 (00:46 +0000)
coders/png.c

index 1d48290c06b16c3ec2f55d39c43ed1f39734ad09..b33ebba82b96732a72628e0715c5a8e93ef6f545 100644 (file)
@@ -3935,8 +3935,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
 static Image *ReadPNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
 {
   Image
-    *image,
-    *previous;
+    *image;
 
   MagickBooleanType
     have_mng_structure,
@@ -3996,21 +3995,11 @@ static Image *ReadPNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
   mng_info->image=image;
   have_mng_structure=MagickTrue;
 
-  previous=image;
   image=ReadOnePNGImage(mng_info,image_info,exception);
   MngInfoFreeStruct(mng_info,&have_mng_structure);
 
   if (image == (Image *) NULL)
     {
-      if (previous != (Image *) NULL)
-        {
-          if (previous->signature != MagickSignature)
-            ThrowReaderException(CorruptImageError,"CorruptImage");
-
-          (void) CloseBlob(previous);
-          (void) DestroyImageList(previous);
-        }
-
       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "exit ReadPNGImage() with error");