From: Cristy Date: Sat, 24 Mar 2018 16:49:26 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/1042 X-Git-Tag: 7.0.7-28~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=505b59d7377b55931e317cecacd470e5bce3147a;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1042 --- diff --git a/coders/art.c b/coders/art.c index 7565680ef..a162e8835 100644 --- a/coders/art.c +++ b/coders/art.c @@ -168,10 +168,7 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception) pixels=(const unsigned char *) ReadBlobStream(image,length, GetQuantumPixels(quantum_info),&count); if (count != (ssize_t) length) - { - quantum_info=DestroyQuantumInfo(quantum_info); - ThrowReaderException(CorruptImageError,"UnableToReadImageData"); - } + break; (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, GrayQuantum,pixels,exception); pixels=(const unsigned char *) ReadBlobStream(image,(size_t) (-(ssize_t) @@ -183,6 +180,8 @@ static Image *ReadARTImage(const ImageInfo *image_info,ExceptionInfo *exception) } SetQuantumImageType(image,GrayQuantum); quantum_info=DestroyQuantumInfo(quantum_info); + if (y < (ssize_t) image->rows) + ThrowReaderException(CorruptImageError,"UnableToReadImageData"); if (EOFBlob(image) != MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename);