From: Cristy Date: Thu, 29 Jun 2017 15:37:30 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/533 X-Git-Tag: 7.0.6-1~110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94933146cb2d9d95889a385f08d5eb5f92d4e3cd;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/533 --- diff --git a/coders/dcm.c b/coders/dcm.c index f1be260dc..04584d505 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3269,6 +3269,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) else if ((quantum != 0) && (length != 0)) { + if (length > GetBlobSize(image)) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); if (~length >= 1) data=(unsigned char *) AcquireQuantumMemory(length+1,quantum* sizeof(*data));