]> granicus.if.org Git - imagemagick/commitdiff
Fixed check that determines if enough bytes are read (https://bugs.chromium.org/p...
authorDirk Lemstra <dirk@git.imagemagick.org>
Fri, 13 Apr 2018 07:50:14 +0000 (09:50 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Fri, 13 Apr 2018 07:50:38 +0000 (09:50 +0200)
coders/icon.c

index f7bb8a89a08d53385301b8e23da3d832ffdd9253..677380ab5b7e2c4e4e00acdfbc1780b3c75c687b 100644 (file)
@@ -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);