]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6653
authorCristy <urban-warrior@imagemagick.org>
Fri, 2 Mar 2018 11:23:51 +0000 (06:23 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 2 Mar 2018 11:23:51 +0000 (06:23 -0500)
coders/scr.c

index a418e630c061db4c6359be122601eb159bb74554..6fcd1b11a144ec814891ce441e9def907548000c 100644 (file)
@@ -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++)