From: Cristy Date: Thu, 19 Apr 2018 23:55:02 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-29~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bbc11ff474e67f750d189e43331fbe667c4135cd;p=imagemagick ... --- diff --git a/coders/rle.c b/coders/rle.c index 5da2136e6..3da2a395f 100644 --- a/coders/rle.c +++ b/coders/rle.c @@ -317,11 +317,10 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) if (comment == (char *) NULL) ThrowRLEException(ResourceLimitError,"MemoryAllocationFailed"); count=ReadBlob(image,length-1,(unsigned char *) comment); - if (count == (length-1)) - { - comment[length-1]='\0'; - (void) SetImageProperty(image,"comment",comment,exception); - } + if (count != (length-1)) + ThrowRLEException(CorruptImageError,"UnexpectedEndOfFile"); + comment[length-1]='\0'; + (void) SetImageProperty(image,"comment",comment,exception); comment=DestroyString(comment); if ((length & 0x01) == 0) (void) ReadBlobByte(image);