From: Cristy Date: Tue, 13 Feb 2018 11:56:54 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6263 X-Git-Tag: 7.0.7-23~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98af0b048417bdc51725ba06f28902c69911529a;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6263 --- 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) ||