From 98af0b048417bdc51725ba06f28902c69911529a Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 13 Feb 2018 06:56:54 -0500 Subject: [PATCH] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6263 --- coders/dcm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/coders/dcm.c b/coders/dcm.c index 82e8207c4..3e8fd15dc 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -4008,7 +4008,14 @@ static Image *ReadDCMImage(const ImageInfo *image_info,ExceptionInfo *exception) Read RLE segment table. */ for (i=0; i < (ssize_t) stream_info->remaining; i++) - (void) ReadBlobByte(image); + { + int + c; + + c=ReadBlobByte(image); + if (c == EOF) + break; + } tag=(ReadBlobLSBShort(image) << 16) | ReadBlobLSBShort(image); stream_info->remaining=(size_t) ReadBlobLSBLong(image); if ((tag != 0xFFFEE000) || (stream_info->remaining <= 64) || -- 2.40.0