From d065756a01e652faa6a39ed7650a76a50f833069 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 5 Feb 2018 20:13:48 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5556 --- coders/dcm.c | 2 ++ 1 file changed, 2 insertions(+) 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) { -- 2.40.0