From: Cristy Date: Fri, 2 Mar 2018 11:23:51 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6653 X-Git-Tag: 7.0.7-25~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=164af31c8d4d5afd0a5a6a7e27078b5d579adc56;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6653 --- diff --git a/coders/scr.c b/coders/scr.c index a418e630c..6fcd1b11a 100644 --- a/coders/scr.c +++ b/coders/scr.c @@ -160,8 +160,11 @@ static Image *ReadSCRImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) return(DestroyImageList(image)); count=ReadBlob(image,6144,(unsigned char *) zxscr); - (void) count; + if (count != 6144) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); count=ReadBlob(image,768,(unsigned char *) zxattr); + if (count != 768) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); for(zonenr=0;zonenr<3;zonenr++) { for(zoneline=0;zoneline<8;zoneline++)