Skip to content

Commit ecb31db

Browse files
author
Cristy
committed
https://github.com/ImageMagick/ImageMagick/issues/1268
1 parent 817f6ab commit ecb31db

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: coders/bmp.c

+2
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
661661
bmp_info.x_pixels=ReadBlobLSBLong(image);
662662
bmp_info.y_pixels=ReadBlobLSBLong(image);
663663
bmp_info.number_colors=ReadBlobLSBLong(image);
664+
if (bmp_info.number_colors > GetBlobSize(image))
665+
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
664666
bmp_info.colors_important=ReadBlobLSBLong(image);
665667
if (image->debug != MagickFalse)
666668
{

0 commit comments

Comments
 (0)