(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 18 Jun 2015 23:36:31 +0000 (23:36 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 18 Jun 2015 23:36:31 +0000 (23:36 +0000)
coders/rle.c

index 3d7bb9098986ffeef4fecd3da4e08287d3baf126..0bd024a3fcacce9f7ec8bd8af9c0f9729197bf08 100644 (file)
@@ -216,8 +216,8 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
     /*
       Read image header.
     */
-    (void) ReadBlobLSBShort(image);
-    (void) ReadBlobLSBShort(image);
+    image->page.x=ReadBlobLSBShort(image);
+    image->page.y=ReadBlobLSBShort(image);
     image->columns=ReadBlobLSBShort(image);
     image->rows=ReadBlobLSBShort(image);
     flags=(MagickStatusType) ReadBlobByte(image);
@@ -253,6 +253,12 @@ static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception)
       }
     if ((number_planes & 0x01) == 0)
       (void) ReadBlobByte(image);
+    if (EOFBlob(image) != MagickFalse)
+      {
+        ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+          image->filename);
+        break;
+      }
     colormap=(unsigned char *) NULL;
     if (number_colormaps != 0)
       {