Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from OSGeo:master #146

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions third_party/libertiff/libertiff.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,12 @@ class Image
uint64_t offset = imageOffset;
if LIBERTIFF_CONSTEXPR (isBigTIFF)
{
// To prevent unsigned integer overflows in later additions. The
// theoretical max should be much closer to UINT64_MAX, but half of
// it is already more than needed in practice :-)
if (offset >= std::numeric_limits<uint64_t>::max() / 2)
return nullptr;

const auto tagCount64Bit = rc->read<uint64_t>(offset, ok);
// Artificially limit to the same number of entries as ClassicTIFF
if (tagCount64Bit > std::numeric_limits<uint16_t>::max())
Expand Down
Loading