Skip to content

Commit

Permalink
Force tile sizes to be less than INT_MAX bytes, in line with the maxi…
Browse files Browse the repository at this point in the history
…mum dimensions of data windows

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
  • Loading branch information
peterhillman committed Feb 4, 2020
1 parent 1cbf6b9 commit 6bad53a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ Header::sanityCheck (bool isTiled, bool isMultipartFile) const

const TileDescription &tileDesc = tileDescription();

if (tileDesc.xSize <= 0 || tileDesc.ySize <= 0)
if (tileDesc.xSize <= 0 || tileDesc.ySize <= 0 || tileDesc.xSize > INT_MAX || tileDesc.ySize > INT_MAX )
throw IEX_NAMESPACE::ArgExc ("Invalid tile size in image header.");

if (maxTileWidth > 0 &&
Expand Down

0 comments on commit 6bad53a

Please sign in to comment.