From: Cristy Date: Sat, 24 Mar 2018 16:35:48 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/1039 X-Git-Tag: 7.0.7-28~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38c759a70780d705e0b8f6afccea14af08b5f9ad;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1039 --- diff --git a/coders/art.c b/coders/art.c index 3feb99396..7565680ef 100644 --- a/coders/art.c +++ b/coders/art.c @@ -337,7 +337,7 @@ static MagickBooleanType WriteARTImage(const ImageInfo *image_info,Image *image, GrayQuantum,pixels,exception); count=WriteBlob(image,length,pixels); if (count != (ssize_t) length) - ThrowWriterException(CorruptImageError,"UnableToWriteImageData"); + break; count=WriteBlob(image,(size_t) (-(ssize_t) length) & 0x01,pixels); status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, image->rows); @@ -345,6 +345,8 @@ static MagickBooleanType WriteARTImage(const ImageInfo *image_info,Image *image, break; } quantum_info=DestroyQuantumInfo(quantum_info); + if (y < (ssize_t) image->rows) + ThrowWriterException(CorruptImageError,"UnableToWriteImageData"); (void) CloseBlob(image); return(status); }