From: Dirk Lemstra Date: Fri, 13 Apr 2018 07:50:14 +0000 (+0200) Subject: Fixed check that determines if enough bytes are read (https://bugs.chromium.org/p... X-Git-Tag: 7.0.7-29~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73c0e9d0818fd6dce4bc891f6fc839ca92455db5;p=imagemagick Fixed check that determines if enough bytes are read (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7502). --- diff --git a/coders/icon.c b/coders/icon.c index f7bb8a89a..677380ab5 100644 --- a/coders/icon.c +++ b/coders/icon.c @@ -369,7 +369,7 @@ static Image *ReadICONImage(const ImageInfo *image_info, png[15]=(unsigned char) (icon_info.bits_per_pixel >> 8); count=ReadBlob(image,length-16,png+16); icon_image=(Image *) NULL; - if (count > 0) + if (count == (ssize_t) length-16) { read_info=CloneImageInfo(image_info); (void) CopyMagickString(read_info->magick,"PNG",MagickPathExtent);