mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 14:14:45 +03:00
LibGfx/TIFF: Also seek after reading the last tag
The `read_tag()` function is not mandated to keep the reading head at a meaningful position, so we also need to align the pointer after the last tag. This solves a bug where reading the last field of an IFD, which is placed after the tags, was incorrect.
This commit is contained in:
parent
a43793ee0d
commit
42f29b9670
Notes:
sideshowbarker
2024-07-17 02:21:14 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/42f29b9670 Pull-request: https://github.com/SerenityOS/serenity/pull/23062 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/nico ✅
@ -498,7 +498,6 @@ private:
|
||||
auto next_tag_offset = TRY(m_stream->tell());
|
||||
|
||||
for (u16 i = 0; i < number_of_field; ++i) {
|
||||
TRY(m_stream->seek(next_tag_offset));
|
||||
if (auto maybe_error = read_tag(); maybe_error.is_error() && TIFF_DEBUG)
|
||||
dbgln("Unable to decode tag {}/{}", i + 1, number_of_field);
|
||||
|
||||
@ -506,6 +505,7 @@ private:
|
||||
// IFD Entry
|
||||
// Size of tag(u16) + type(u16) + count(u32) + value_or_offset(u32) = 12
|
||||
next_tag_offset += 12;
|
||||
TRY(m_stream->seek(next_tag_offset));
|
||||
}
|
||||
|
||||
TRY(read_next_idf_offset());
|
||||
|
Loading…
Reference in New Issue
Block a user