From: Cristy Date: Wed, 13 Sep 2017 14:49:56 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-3~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f420dab6498e0765256cb25d96998963996c29d8;p=imagemagick ... --- diff --git a/coders/raw.c b/coders/raw.c index 5871c4cb5..b91282bb5 100644 --- a/coders/raw.c +++ b/coders/raw.c @@ -135,13 +135,16 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception) image=AcquireImage(image_info,exception); if ((image->columns == 0) || (image->rows == 0)) ThrowReaderException(OptionError,"MustSpecifyImageSize"); + status=SetImageExtent(image,image->columns,image->rows,exception); + if (status == MagickFalse) + return(DestroyImageList(image)); status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); if (status == MagickFalse) { image=DestroyImageList(image); return((Image *) NULL); } - if (DiscardBlobBytes(image,image->offset) == MagickFalse) + if (DiscardBlobBytes(image,(MagickSizeType) image->offset) == MagickFalse) ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); /* @@ -185,7 +188,7 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception) break; status=SetImageExtent(image,image->columns,image->rows,exception); if (status == MagickFalse) - return(DestroyImageList(image)); + break; if (scene == 0) { length=GetQuantumExtent(canvas_image,quantum_info,quantum_type);