From: Cristy Date: Tue, 6 Feb 2018 01:13:48 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5556 X-Git-Tag: 7.0.7-23~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d065756a01e652faa6a39ed7650a76a50f833069;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5556 --- diff --git a/coders/dcm.c b/coders/dcm.c index a4a1372b6..618979850 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -3914,6 +3914,8 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) tag=(ReadBlobLSBShort(image) << 16) | ReadBlobLSBShort(image); (void) tag; length=(size_t) ReadBlobLSBLong(image); + if (length > GetBlobSize(image)) + ThrowDCMException(CorruptImageError,"InsufficientImageDataInFile"); stream_info->offset_count=length >> 2; if (stream_info->offset_count != 0) {