mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-23 11:04:40 +00:00
LibGfx/JPEG2000: Check tile_part_length ("Psot") validity
This commit is contained in:
parent
1393719f10
commit
259c3fc7d3
|
@ -249,6 +249,8 @@ static ErrorOr<void> parse_codestream_tile_header(JPEG2000LoadingContext& contex
|
|||
tile_bitstream_length = context.codestream_data.size() - context.codestream_cursor - 2;
|
||||
} else {
|
||||
u32 tile_header_length = context.codestream_cursor - tile_start;
|
||||
if (start_of_tile.tile_part_length < tile_header_length)
|
||||
return Error::from_string_literal("JPEG2000ImageDecoderPlugin: Invalid tile part length");
|
||||
tile_bitstream_length = start_of_tile.tile_part_length - tile_header_length;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue