]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Thu, 19 Apr 2018 23:55:02 +0000 (19:55 -0400)
committerCristy <urban-warrior@imagemagick.org>
Thu, 19 Apr 2018 23:55:02 +0000 (19:55 -0400)
coders/rle.c

index 5da2136e61f9f117de1bef39e9b36fb8ae73a2d2..3da2a395f8ff5561a02a96d5cc1b45a4e1ad6e8c 100644 (file)
@@ -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);