Skip to content

Commit

Permalink
Change >= to > in overflow calculation
Browse files Browse the repository at this point in the history
Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Aug 9, 2020
1 parent d548fd5 commit 46833b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OpenEXR/IlmImf/ImfTiledMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ calculateNumTiles (int *numTiles,
{
for (int i = 0; i < numLevels; i++)
{
int l = levelSize (min, max, i, rmode);
if (l >= std::numeric_limits<int>::max() - size + 1)
int l = levelSize (min, max, i, rmode);
if (l > std::numeric_limits<int>::max() - size + 1)
throw IEX_NAMESPACE::ArgExc ("Invalid size.");

numTiles[i] = (l + size - 1) / size;
numTiles[i] = (l + size - 1) / size;
}
}

Expand Down

0 comments on commit 46833b0

Please sign in to comment.