1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

LibGfx: Use read_effective_chunk_size() in skip_segment()

We missed this one in d184e6014ccd8.

No behavior change in valid JPEGs. No silent underflow in invalid ones.
This commit is contained in:
Nico Weber 2024-01-15 14:09:00 -05:00 committed by Sam Atkins
parent 3616d14c80
commit fbde901614

View file

@ -1351,7 +1351,7 @@ static ErrorOr<void> read_quantization_table(JPEGStream& stream, JPEGLoadingCont
static ErrorOr<void> skip_segment(JPEGStream& stream)
{
u16 bytes_to_skip = TRY(stream.read_u16()) - 2;
u16 bytes_to_skip = TRY(read_effective_chunk_size(stream));
TRY(stream.discard(bytes_to_skip));
return {};
}