mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:27:35 +00:00
LibGfx/BMPLoader: Account for header size when checking DIB bounds
This commit is contained in:
parent
4e0a926737
commit
8ec26f3b54
1 changed files with 1 additions and 1 deletions
|
@ -845,7 +845,7 @@ static ErrorOr<void> decode_bmp_dib(BMPLoadingContext& context)
|
||||||
dib_offset = context.data_offset - header_size - 4;
|
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");
|
return Error::from_string_literal("DIB too large");
|
||||||
|
|
||||||
streamer = InputStreamer(context.file_bytes + header_size + 4, dib_offset);
|
streamer = InputStreamer(context.file_bytes + header_size + 4, dib_offset);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue