From: Cristy Date: Wed, 7 Feb 2018 21:28:22 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6071 X-Git-Tag: 7.0.7-23~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4a6230fe074791f82f8c6a36413118bedf7f772;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6071 --- diff --git a/coders/dcm.c b/coders/dcm.c index 618979850..8885e1dd2 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3887,6 +3887,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) Compute pixel scaling table. */ length=(size_t) (GetQuantumRange(info.depth)+1); + if (length > GetBlobSize(image)) + ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile"); info.scale=(Quantum *) AcquireQuantumMemory(length,sizeof(*info.scale)); if (info.scale == (Quantum *) NULL) ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed");