]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1517
authorCristy <mikayla-grace@urban-warrior.org>
Sat, 23 Mar 2019 18:52:07 +0000 (14:52 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Sat, 23 Mar 2019 18:52:07 +0000 (14:52 -0400)
coders/dpx.c

index 29f6f55db350677ba6eb0b3dd126862ecff695c1..d69cd983fa9ed4af675053f9aabf2c1f7d766c7c 100644 (file)
@@ -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);
 }