From: Cristy Date: Sat, 23 Mar 2019 18:52:07 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/1517 X-Git-Tag: 7.0.8-35~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca720b5f0fdd45a1aa5a3f501ecb466bc936a5b2;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1517 --- diff --git a/coders/dpx.c b/coders/dpx.c index 29f6f55db..d69cd983f 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -2014,13 +2014,16 @@ static MagickBooleanType WriteDPXImage(const ImageInfo *image_info,Image *image, pixels=(unsigned char *) GetQuantumPixels(quantum_info); for (y=0; y < (ssize_t) image->rows; y++) { + size_t + length; + p=GetVirtualPixels(image,0,y,image->columns,1,exception); if (p == (const Quantum *) NULL) break; - (void) ExportQuantumPixels(image,(CacheView *) NULL,quantum_info, + length=ExportQuantumPixels(image,(CacheView *) NULL,quantum_info, quantum_type,pixels,exception); count=WriteBlob(image,extent,pixels); - if (count != (ssize_t) extent) + if (count != (ssize_t) length) break; status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y, image->rows); @@ -2028,6 +2031,8 @@ static MagickBooleanType WriteDPXImage(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); }