mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 13:02:28 +00:00
LibGfx: Prevent potential heap-overflow in BMP non-RLE
This commit is contained in:
parent
461bdeda2b
commit
6be9b6349d
Notes:
sideshowbarker
2024-07-19 01:06:38 +09:00
Author: https://github.com/BenWiederhake
Commit: 6be9b6349d
Pull-request: https://github.com/SerenityOS/serenity/pull/4294
Issue: https://github.com/SerenityOS/serenity/issues/4206
1 changed files with 1 additions and 1 deletions
|
@ -1200,7 +1200,7 @@ static bool decode_bmp_pixel_data(BMPLoadingContext& context)
|
||||||
return false;
|
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
|
if (context.dib.info.compression == Compression::RLE4 || context.dib.info.compression == Compression::RLE8
|
||||||
|| context.dib.info.compression == Compression::RLE24) {
|
|| context.dib.info.compression == Compression::RLE24) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue