From: Cristy Date: Mon, 3 Jul 2017 00:41:19 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.6-1~84 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67385324ef15b163add2ca0a882c0f2d65d36122;p=imagemagick ... --- diff --git a/coders/png.c b/coders/png.c index 097bca788..8c8f0c69f 100644 --- a/coders/png.c +++ b/coders/png.c @@ -4136,8 +4136,7 @@ static Image *ReadPNGImage(const ImageInfo *image_info, ThrowReaderException(CorruptImageError,"ImproperImageHeader"); /* - Verify that file size large enough to contain a PNG datastream - if using a seekable blob + Verify that file size large enough to contain a PNG datastream. */ if (GetBlobSize(image) < 61) ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); @@ -5032,7 +5031,10 @@ static Image *ReadJNGImage(const ImageInfo *image_info, if (count < 8 || memcmp(magic_number,"\213JNG\r\n\032\n",8) != 0) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); - if (IsBlobSeekable(image) && GetBlobSize(image) < 147) + /* + Verify that file size large enough to contain a JNG datastream. + */ + if (GetBlobSize(image) < 147) ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); /* Allocate a MngInfo structure. */