From: Cristy Date: Thu, 14 Sep 2017 11:18:36 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-3~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a610d4dde634e2162213641a2b6e28236503e2e;p=imagemagick ... --- diff --git a/coders/raw.c b/coders/raw.c index b91282bb5..43cafa88d 100644 --- a/coders/raw.c +++ b/coders/raw.c @@ -178,6 +178,7 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception) scene=0; count=0; length=0; + status=MagickTrue; do { /* @@ -208,6 +209,7 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception) if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", image->filename); break; @@ -278,6 +280,8 @@ static Image *ReadRAWImage(const ImageInfo *image_info,ExceptionInfo *exception) quantum_info=DestroyQuantumInfo(quantum_info); canvas_image=DestroyImage(canvas_image); (void) CloseBlob(image); + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); }