mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibGfx: Prevent potential heap-overflow in BMP non-RLE
This commit is contained in:
parent
461bdeda2b
commit
6be9b6349d
1 changed files with 1 additions and 1 deletions
|
@ -1200,7 +1200,7 @@ static bool decode_bmp_pixel_data(BMPLoadingContext& context)
|
|||
return false;
|
||||
}
|
||||
|
||||
auto buffer = ByteBuffer::wrap(const_cast<u8*>(context.file_bytes + context.data_offset), context.file_size);
|
||||
auto buffer = ByteBuffer::wrap(const_cast<u8*>(context.file_bytes + context.data_offset), context.file_size - context.data_offset);
|
||||
|
||||
if (context.dib.info.compression == Compression::RLE4 || context.dib.info.compression == Compression::RLE8
|
||||
|| context.dib.info.compression == Compression::RLE24) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue