]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/443
authorCristy <urban-warrior@imagemagick.org>
Wed, 26 Apr 2017 19:26:21 +0000 (15:26 -0400)
committerCristy <urban-warrior@imagemagick.org>
Wed, 26 Apr 2017 19:26:21 +0000 (15:26 -0400)
coders/sfw.c

index b3526a76082eaa58791e2ec07d3e1403be297d20..5d2cc60c261a0f89efdb030afb93366996185ffd 100644 (file)
@@ -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