From a09307224c224a12739587bc5bd38681b1557a35 Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 29 Dec 2017 14:48:04 -0500 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/924 --- coders/dpx.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/coders/dpx.c b/coders/dpx.c index 97cce53c6..bc021bad7 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -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) -- 2.40.0