From: Cristy Date: Wed, 13 Jun 2018 23:05:32 +0000 (-0400) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8863 X-Git-Tag: 7.0.8-1~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f26d13bd5e0e2ad4dbd04677544906027edae46b;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8863 --- diff --git a/coders/png.c b/coders/png.c index 285daf8df..058594e13 100644 --- a/coders/png.c +++ b/coders/png.c @@ -4248,7 +4248,7 @@ static Image *ReadPNGImage(const ImageInfo *image_info, status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) - ThrowReaderException(FileOpenError,"UnableToOpenFile"); + return(DestroyImageList(image)); /* Verify PNG signature. @@ -5217,7 +5217,7 @@ static Image *ReadJNGImage(const ImageInfo *image_info, status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) - return((Image *) NULL); + return(DestroyImageList(image)); if (LocaleCompare(image_info->magick,"JNG") != 0) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); @@ -7730,7 +7730,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info, status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) - return((Image *) NULL); + return(DestroyImageList(image)); /* Allocate a MngInfo structure. */