From: Dirk Lemstra Date: Sun, 7 May 2017 10:17:31 +0000 (+0200) Subject: Fixed memory leak reported in #476. X-Git-Tag: 7.0.5-6~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7fcca7ff26c0579f3010222b9a44063ba0b45182;p=imagemagick Fixed memory leak reported in #476. --- diff --git a/coders/png.c b/coders/png.c index d212497dd..c194d0858 100644 --- a/coders/png.c +++ b/coders/png.c @@ -5579,7 +5579,10 @@ static Image *ReadOneMNGImage(MngInfo* mng_info, const ImageInfo *image_info, if ((mng_info->mng_width > 65535L) || (mng_info->mng_height > 65535L)) - ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit"); + { + chunk=(unsigned char *) RelinquishMagickMemory(chunk); + ThrowReaderException(ImageError,"WidthOrHeightExceedsLimit"); + } (void) FormatLocaleString(page_geometry,MagickPathExtent, "%.20gx%.20g+0+0",(double) mng_info->mng_width,(double)