Skip to content

Commit

Permalink
third_party/libertiff: avoid issue with invalid offline tags with val…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 9, 2025
1 parent 196f855 commit eb84213
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions third_party/libertiff/libertiff.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,14 @@ class Image
{
// Out-of-line values. We read a file offset
entry.value_offset = m_rc->read<DataOrOffsetType>(offset, ok);
if (entry.value_offset == 0)
{
// value_offset = 0 for a out-of-line tag is obviously
// wrong and would cause later confusion in readTagAsVector<>,
// so better reject the file.
ok = false;
return;
}
if (dataTypeSize >
std::numeric_limits<uint64_t>::max() / entry.count)
{
Expand Down

0 comments on commit eb84213

Please sign in to comment.