Skip to content

Commit eb84213

Browse files
committed
third_party/libertiff: avoid issue with invalid offline tags with value offset at zero
Fixes https://issues.oss-fuzz.com/issues/388571282
1 parent 196f855 commit eb84213

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

third_party/libertiff/libertiff.hpp

+8
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,14 @@ class Image
15251525
{
15261526
// Out-of-line values. We read a file offset
15271527
entry.value_offset = m_rc->read<DataOrOffsetType>(offset, ok);
1528+
if (entry.value_offset == 0)
1529+
{
1530+
// value_offset = 0 for a out-of-line tag is obviously
1531+
// wrong and would cause later confusion in readTagAsVector<>,
1532+
// so better reject the file.
1533+
ok = false;
1534+
return;
1535+
}
15281536
if (dataTypeSize >
15291537
std::numeric_limits<uint64_t>::max() / entry.count)
15301538
{

0 commit comments

Comments
 (0)