Skip to content

Commit

Permalink
validate tiles have valid headers when raw reading tiles
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
  • Loading branch information
peterhillman committed Jan 19, 2020
1 parent 04c3467 commit 7d24190
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OpenEXR/IlmImf/ImfTiledInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,11 @@ TiledInputFile::rawTileData (int &dx, int &dy,
readNextTileData (_data->_streamData, _data, dx, dy, lx, ly,
tileBuffer->buffer,
pixelDataSize);

if ( !isValidLevel(lx,ly) || !isValidTile (dx, dy, lx, ly) )
throw IEX_NAMESPACE::ArgExc ("File contains an invalid tile");


if(isMultiPart(version()))
{
if (old_dx!=dx || old_dy !=dy || old_lx!=lx || old_ly!=ly)
Expand Down

0 comments on commit 7d24190

Please sign in to comment.