File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Userland/Libraries/LibGfx/ImageFormats Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,18 @@ class TIFFLoadingContext {
42
42
return {};
43
43
}
44
44
45
+ ErrorOr<void > ensure_baseline_tags_correctness () const
46
+ {
47
+ if (m_metadata.strip_offsets ()->size () != m_metadata.strip_byte_counts ()->size ())
48
+ return Error::from_string_literal (" TIFFImageDecoderPlugin: StripsOffset and StripByteCount have different sizes" );
49
+
50
+ return {};
51
+ }
52
+
45
53
ErrorOr<void > decode_frame ()
46
54
{
47
55
TRY (ensure_baseline_tags_presence (m_metadata));
56
+ TRY (ensure_baseline_tags_correctness ());
48
57
auto maybe_error = decode_frame_impl ();
49
58
50
59
if (maybe_error.is_error ()) {
@@ -195,9 +204,6 @@ class TIFFLoadingContext {
195
204
auto const strips_offset = *m_metadata.strip_offsets ();
196
205
auto const strip_byte_counts = *m_metadata.strip_byte_counts ();
197
206
198
- if (strips_offset.size () != strip_byte_counts.size ())
199
- return Error::from_string_literal (" TIFFImageDecoderPlugin: StripsOffset and StripByteCount have different sizes, aborting..." );
200
-
201
207
for (u32 strip_index = 0 ; strip_index < strips_offset.size (); ++strip_index) {
202
208
TRY (m_stream->seek (strips_offset[strip_index]));
203
209
You can’t perform that action at this time.
0 commit comments