Don't destroy a NULL "previous" image in the PNG decoder.
diff --git a/coders/png.c b/coders/png.c
index 1d48290..b33ebba 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -3935,8 +3935,7 @@
static Image *ReadPNGImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
Image
- *image,
- *previous;
+ *image;
MagickBooleanType
have_mng_structure,
@@ -3996,21 +3995,11 @@
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");