From 505b59d7377b55931e317cecacd470e5bce3147a Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 24 Mar 2018 12:49:26 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1042 --- coders/art.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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); -- 2.40.0