1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

LibGfx/BMPLoader: Account for header size when checking DIB bounds

This commit is contained in:
Tim Ledbetter 2023-10-19 21:42:04 +01:00 committed by Andreas Kling
parent 4e0a926737
commit 8ec26f3b54

View file

@ -845,7 +845,7 @@ static ErrorOr<void> decode_bmp_dib(BMPLoadingContext& context)
dib_offset = context.data_offset - header_size - 4;
}
if (dib_offset >= context.file_size)
if (dib_offset + header_size + 4 >= context.file_size)
return Error::from_string_literal("DIB too large");
streamer = InputStreamer(context.file_bytes + header_size + 4, dib_offset);