mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-05-31 11:18:42 +02:00
Added extra check to resolve issue on 32-bit systems (https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-9pp9-cfwx-54rm)
This commit is contained in:
@@ -1117,6 +1117,8 @@ static Image *ReadBMPImage(const ImageInfo *image_info,ExceptionInfo *exception)
|
||||
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
|
||||
if (bmp_info.compression == BI_RLE4)
|
||||
bmp_info.bits_per_pixel<<=1;
|
||||
if (BMPOverflowCheck(image->columns,bmp_info.bits_per_pixel) != MagickFalse)
|
||||
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
|
||||
extent=image->columns*bmp_info.bits_per_pixel;
|
||||
bytes_per_line=4*((extent+31)/32);
|
||||
if (BMPOverflowCheck(bytes_per_line,image->rows) != MagickFalse)
|
||||
|
||||
Reference in New Issue
Block a user