File ImageMagick-CVE-2016-9556.patch of Package ImageMagick.8212

From ce98a7acbcfca7f0a178f4b1e7b957e419e0cc99 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Wed, 16 Nov 2016 15:50:12 -0500
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/301

---
 coders/sgi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/coders/sgi.c b/coders/sgi.c
index 6b0e9eb..a0eebe9 100644
--- a/coders/sgi.c
+++ b/coders/sgi.c
@@ -332,6 +332,8 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception)
     if ((iris_info.bytes_per_pixel == 0) || (iris_info.bytes_per_pixel > 2))
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     iris_info.dimension=ReadBlobMSBShort(image);
+    if ((iris_info.dimension == 0) || (iris_info.dimension > 3)) 
+      ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     iris_info.columns=ReadBlobMSBShort(image);
     iris_info.rows=ReadBlobMSBShort(image);
     iris_info.depth=ReadBlobMSBShort(image);