File ImageMagick-CVE-2017-9500.patch of Package ImageMagick.8212

Index: ImageMagick-6.8.8-1/coders/miff.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/miff.c	2018-03-06 10:28:09.509664652 +0100
+++ ImageMagick-6.8.8-1/coders/miff.c	2018-03-06 10:30:19.351936120 +0100
@@ -1100,6 +1100,9 @@ static Image *ReadMIFFImage(const ImageI
         (image->storage_class == UndefinedClass) ||
         (image->columns == 0) || (image->rows == 0))
       {
+        if (image->previous == (Image *) NULL)
+          ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+        DeleteImageFromList(&image);
         if (profiles != (LinkedListInfo *) NULL)
           profiles=DestroyLinkedList(profiles,RelinquishMagickMemory);
         ThrowReaderException(CorruptImageError,"ImproperImageHeader");