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

Index: ImageMagick-6.8.9-8/coders/dcm.c
===================================================================
--- ImageMagick-6.8.9-8.orig/coders/dcm.c	2016-06-23 08:37:11.009022275 +0200
+++ ImageMagick-6.8.9-8/coders/dcm.c	2016-06-23 08:38:06.941913089 +0200
@@ -3191,6 +3191,8 @@ static Image *ReadDCMImage(const ImageIn
             /*
               Photometric interpretation.
             */
+            if (data == (unsigned char *) NULL)
+              break;
             for (i=0; i < (ssize_t) MagickMin(length,MaxTextExtent-1); i++)
               photometric[i]=(char) data[i];
             photometric[i]='\0';
@@ -3212,6 +3214,8 @@ static Image *ReadDCMImage(const ImageIn
             /*
               Number of frames.
             */
+            if (data == (unsigned char *) NULL)
+              break;
             number_scenes=StringToUnsignedLong((char *) data);
             break;
           }