Skip to content

Commit 456771f

Browse files
committed
Added extra check to resolve issue on 32-bit systems (GHSA-9pp9-cfwx-54rm)
1 parent 3e238e5 commit 456771f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

coders/bmp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
11321132
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
11331133
if (bmp_info.compression == BI_RLE4)
11341134
bmp_info.bits_per_pixel<<=1;
1135+
if (BMPOverflowCheck(image->columns,bmp_info.bits_per_pixel) != MagickFalse)
1136+
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
11351137
extent=image->columns*bmp_info.bits_per_pixel;
11361138
bytes_per_line=4*((extent+31)/32);
11371139
if (BMPOverflowCheck(bytes_per_line,image->rows) != MagickFalse)

0 commit comments

Comments
 (0)