From bbc11ff474e67f750d189e43331fbe667c4135cd Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 19 Apr 2018 19:55:02 -0400 Subject: [PATCH] ... --- coders/rle.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); -- 2.40.0