mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
LibGfx/JPEG: Discard the correct number of bytes
This path has never been tested as it requires a non-standard APP segment. We (un?)fortunately found one, and it exposed a silly bug.
This commit is contained in:
parent
5896f4c400
commit
e81baa0464
1 changed files with 2 additions and 2 deletions
|
@ -1042,8 +1042,8 @@ static ErrorOr<void> read_colour_encoding(Stream& stream, [[maybe_unused]] JPEGL
|
|||
auto const color_transform = TRY(stream.read_value<u8>());
|
||||
|
||||
if (bytes_to_read > 6) {
|
||||
dbgln_if(JPEG_DEBUG, "Unread bytes in App14 segment: {}", bytes_to_read - 1);
|
||||
TRY(stream.discard(bytes_to_read - 1));
|
||||
dbgln_if(JPEG_DEBUG, "Unread bytes in App14 segment: {}", bytes_to_read - 6);
|
||||
TRY(stream.discard(bytes_to_read - 6));
|
||||
}
|
||||
|
||||
switch (color_transform) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue