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 #198

Merged
merged 2 commits into from
Feb 20, 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
16 changes: 12 additions & 4 deletions third_party/libertiff/libertiff.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,18 +1084,26 @@ class Image
{
if (m_isTiled && m_tileWidth > 0 && m_tileHeight > 0)
{
const auto lTilesPerRow = tilesPerRow();
const auto lTilesPerCol = tilesPerCol();
const uint32_t lTilesPerRow = tilesPerRow();
const uint32_t lTilesPerCol = tilesPerCol();
if (xtile >= lTilesPerRow || ytile >= lTilesPerCol)
{
ok = false;
return 0;
}
auto idx = uint64_t(ytile) * lTilesPerRow + xtile;
uint64_t idx = uint64_t(ytile) * lTilesPerRow + xtile;
if (bandIdx &&
m_planarConfiguration == PlanarConfiguration::Separate)
{
idx += uint64_t(bandIdx) * lTilesPerCol * lTilesPerRow;
const uint64_t lTotalTiles =
uint64_t(lTilesPerCol) * lTilesPerRow;
if (lTotalTiles >
std::numeric_limits<uint64_t>::max() / bandIdx)
{
ok = false;
return 0;
}
idx += bandIdx * lTotalTiles;
}
return idx;
}
Expand Down
Loading