mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
LibGfx/JPEG2000: Fix off-by-one in reading comment data 😬
For text, we always ended up with a leading \0 byte (on little-endian), which prints as nothing. Since that's the only thing we do with this data, no actual behavior change.
This commit is contained in:
parent
b2d7c405cd
commit
2c9c996130
Notes:
sideshowbarker
2024-07-17 03:35:16 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/2c9c996130 Pull-request: https://github.com/SerenityOS/serenity/pull/23906 Reviewed-by: https://github.com/trflynn89
@ -453,7 +453,7 @@ static ErrorOr<Comment> read_comment(ReadonlyBytes data)
|
||||
if (comment_type > 1)
|
||||
return Error::from_string_literal("JPEG2000ImageDecoderPlugin: Invalid comment type");
|
||||
com.type = static_cast<Comment::CommentType>(comment_type);
|
||||
com.data = data.slice(1);
|
||||
com.data = data.slice(2);
|
||||
|
||||
dbgln_if(JPEG2000_DEBUG, "JPEG2000ImageDecoderPlugin: COM marker segment: comment_type={}, size()={}", (int)com.type, com.data.size());
|
||||
if (com.type == Comment::ISO_IEC_8859_15)
|
||||
|
Loading…
Reference in New Issue
Block a user