mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:34:59 +00:00
LibGfx/TIFF: Reject images with invalid StripByteCounts or StripOffsets
These two arrays should have the exact same size, files not respecting this condition should be considered as invalid.
This commit is contained in:
parent
82d40aab18
commit
31b5f17f79
1 changed files with 3 additions and 0 deletions
|
@ -195,6 +195,9 @@ private:
|
|||
auto const strips_offset = *m_metadata.strip_offsets();
|
||||
auto const strip_byte_counts = *m_metadata.strip_byte_counts();
|
||||
|
||||
if (strips_offset.size() != strip_byte_counts.size())
|
||||
return Error::from_string_literal("TIFFImageDecoderPlugin: StripsOffset and StripByteCount have different sizes, aborting...");
|
||||
|
||||
for (u32 strip_index = 0; strip_index < strips_offset.size(); ++strip_index) {
|
||||
TRY(m_stream->seek(strips_offset[strip_index]));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue