]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/924
authorCristy <urban-warrior@imagemagick.org>
Fri, 29 Dec 2017 19:48:04 +0000 (14:48 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 29 Dec 2017 19:48:04 +0000 (14:48 -0500)
coders/dpx.c

index 97cce53c63231895feeb7e4d67317e8837af8374..bc021bad73db896562156bd701c020ccf8a243b5 100644 (file)
@@ -1223,7 +1223,6 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
     /*
       DPX any-bit pixel format.
     */
-    status=MagickTrue;
     row=0;
     quantum_info=AcquireQuantumInfo(image_info,image);
     if (quantum_info == (QuantumInfo *) NULL)
@@ -1248,12 +1247,10 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
       ssize_t
         offset;
 
-      if (status == MagickFalse)
-        continue;
       pixels=(const unsigned char *) ReadBlobStream(image,extent,
         GetQuantumPixels(quantum_info),&count);
       if (count != (ssize_t) extent)
-        status=MagickFalse;
+        break;
       if ((image->progress_monitor != (MagickProgressMonitor) NULL) &&
           (image->previous == (Image *) NULL))
         {
@@ -1263,24 +1260,21 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception)
           proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType) row,
             image->rows);
           if (proceed == MagickFalse)
-            status=MagickFalse;
+            break;
         }
       offset=row++;
       q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception);
       if (q == (Quantum *) NULL)
-        {
-          status=MagickFalse;
-          continue;
-        }
+        break;
       length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,
         quantum_type,pixels,exception);
       (void) length;
       sync=SyncAuthenticPixels(image,exception);
       if (sync == MagickFalse)
-        status=MagickFalse;
+        break;
     }
     quantum_info=DestroyQuantumInfo(quantum_info);
-    if (status == MagickFalse)
+    if (y < (ssize_t) image->rows)
       ThrowReaderException(CorruptImageError,"UnableToReadImageData");
     SetQuantumImageType(image,quantum_type);
     if (EOFBlob(image) != MagickFalse)