]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/912
authorCristy <urban-warrior@imagemagick.org>
Fri, 22 Dec 2017 13:46:25 +0000 (08:46 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 22 Dec 2017 13:46:25 +0000 (08:46 -0500)
coders/miff.c

index 61a51b3f70b588352e3ccd77817f1d54285a2aa4..4d80075c22078aaddb3db01c26d66d0261609e47 100644 (file)
@@ -1086,12 +1086,10 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
         (image->colorspace == UndefinedColorspace) ||
         (image->columns == 0) || (image->rows == 0))
       {
+        if (profiles != (LinkedListInfo *) NULL)
+          profiles=DestroyLinkedList(profiles,RelinquishMagickMemory);
         if (image->previous == (Image *) NULL)
-          {
-            if (profiles != (LinkedListInfo *) NULL)
-              profiles=DestroyLinkedList(profiles,RelinquishMagickMemory);
-            ThrowReaderException(CorruptImageError,"ImproperImageHeader");
-          }
+          ThrowReaderException(CorruptImageError,"ImproperImageHeader");
         DeleteImageFromList(&image);
         (void) ThrowMagickException(exception,GetMagickModule(),
           CorruptImageError,"ImproperImageHeader","`%s'",image->filename);