From: Cristy Date: Thu, 14 Sep 2017 11:15:38 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-3~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90852b8affc1e7ca057fc53fbac72ac260948fb4;p=imagemagick ... --- diff --git a/coders/gray.c b/coders/gray.c index 9b43b7850..865c37ada 100644 --- a/coders/gray.c +++ b/coders/gray.c @@ -183,6 +183,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, scene=0; count=0; length=0; + status=MagickTrue; do { /* @@ -215,6 +216,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, if (count != (ssize_t) length) { + status=MagickFalse; ThrowFileException(exception,CorruptImageError, "UnexpectedEndOfFile",image->filename); break; @@ -283,6 +285,8 @@ static Image *ReadGRAYImage(const ImageInfo *image_info, quantum_info=DestroyQuantumInfo(quantum_info); canvas_image=DestroyImage(canvas_image); (void) CloseBlob(image); + if (status == MagickFalse) + return(DestroyImageList(image)); return(GetFirstImageInList(image)); }