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

From 42ceb8ee940a4c0bddeaf22e5a9c20cea2e85a8f Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Thu, 8 Jun 2017 09:04:32 -0400
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/509

---
 coders/dpx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Index: ImageMagick-6.8.8-1/coders/dpx.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/dpx.c	2017-12-04 14:07:07.360988653 +0100
+++ ImageMagick-6.8.8-1/coders/dpx.c	2017-12-04 14:07:36.741476780 +0100
@@ -1116,10 +1116,11 @@ static Image *ReadDPXImage(const ImageIn
         }
     }
   for ( ; offset < (MagickOffsetType) dpx.file.image_offset; offset++)
-    (void) ReadBlobByte(image);
-  /*
-    Read DPX image header.
-  */
+    if (ReadBlobByte(image) == EOF)
+      break;
+  if (EOFBlob(image) != MagickFalse)
+    ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+      image->filename);
   if (image_info->ping != MagickFalse)
     {
       (void) CloseBlob(image);
@@ -1141,7 +1142,8 @@ static Image *ReadDPXImage(const ImageIn
            offset=SeekBlob(image,data_offset,SEEK_SET);
          else
            for ( ; offset < data_offset; offset++)
-             (void) ReadBlobByte(image);
+             if (ReadBlobByte(image) == EOF)
+               break;
           if (offset != data_offset)
             ThrowReaderException(CorruptImageError,"UnableToReadImageData");
        }