]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/676
authorCristy <urban-warrior@imagemagick.org>
Tue, 15 Aug 2017 11:51:23 +0000 (07:51 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 15 Aug 2017 11:51:23 +0000 (07:51 -0400)
coders/miff.c

index 8b2e2e3216ed9dd6e25ceef968f78d1df2c437f3..7e019a00ae18c5349cfe43680abccb02a2f162c9 100644 (file)
@@ -1087,7 +1087,11 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
         (image->columns == 0) || (image->rows == 0))
       {
         if (image->previous == (Image *) NULL)
-          ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+          {
+            if (profiles != (LinkedListInfo *) NULL)
+              profiles=DestroyLinkedList(profiles,RelinquishMagickMemory);
+            ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+          }
         DeleteImageFromList(&image);
         (void) ThrowMagickException(exception,GetMagickModule(),
           CorruptImageError,"ImproperImageHeader","`%s'",image->filename);