From: glennrp Date: Tue, 25 Nov 2014 00:46:19 +0000 (+0000) Subject: Don't destroy a NULL "previous" image in the PNG decoder. X-Git-Tag: 7.0.1-0~1712 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=919429921a43880a338ed87e128d3b96219442ef;p=imagemagick Don't destroy a NULL "previous" image in the PNG decoder. --- diff --git a/coders/png.c b/coders/png.c index 1d48290c0..b33ebba82 100644 --- a/coders/png.c +++ b/coders/png.c @@ -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");