From: Cristy Date: Wed, 26 Apr 2017 19:26:21 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/443 X-Git-Tag: 7.0.5-6~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b1b7895bb5c75596942e5c642ea44b0dd13ddec;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/443 --- diff --git a/coders/sfw.c b/coders/sfw.c index b3526a760..5d2cc60c2 100644 --- a/coders/sfw.c +++ b/coders/sfw.c @@ -260,7 +260,10 @@ static Image *ReadSFWImage(const ImageInfo *image_info,ExceptionInfo *exception) count=ReadBlob(image,(size_t) GetBlobSize(image),buffer); if ((count != (ssize_t) GetBlobSize(image)) || (LocaleNCompare((char *) buffer,"SFW",3) != 0)) - ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + { + buffer=(unsigned char *) RelinquishMagickMemory(buffer); + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + } (void) CloseBlob(image); /* Find the start of the JFIF data