]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sun, 11 Mar 2018 02:23:12 +0000 (21:23 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sun, 11 Mar 2018 02:23:12 +0000 (21:23 -0500)
coders/bmp.c

index 36fd03b0eac75d93c2751a975601e977d24c69a5..7cf8b7d24b60dc904061c51871d5815203a7c19e 100644 (file)
@@ -961,7 +961,7 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
       bmp_info.bits_per_pixel<<=1;
     bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32);
     length=(size_t) bytes_per_line*image->rows;
-    if ((MagickSizeType) length > GetBlobSize(image))
+    if (((MagickSizeType) length/8) > GetBlobSize(image))
       ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
     if ((bmp_info.compression == BI_RGB) ||
         (bmp_info.compression == BI_BITFIELDS))