File ImageMagick-CVE-2017-12140,12644.patch of Package ImageMagick.8212

Index: ImageMagick-6.8.8-1/coders/dcm.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/dcm.c	2017-12-04 18:21:25.261128743 +0100
+++ ImageMagick-6.8.8-1/coders/dcm.c	2017-12-04 19:50:19.538978651 +0100
@@ -3071,6 +3071,8 @@ static Image *ReadDCMImage(const ImageIn
         else
           if ((quantum != 0) && (length != 0))
             {
+              if (length > GetBlobSize(image))
+                ThrowDCMReaderException(CorruptImageError, "InsufficientImageDataInFile");
               data=(unsigned char *) NULL;
               if (~length >= 1)
                 data=(unsigned char *) AcquireQuantumMemory(length+1,quantum*