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

--- a/coders/dds.c
+++ b/coders/dds.c
@@ -1772,6 +1771,9 @@ static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception)
   if (volume)
     num_images = dds_info.depth;
 
+  if (num_images < 1)
+    ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+
   for (n = 0; n < num_images; n++)
   {
     if (n != 0)