Skip to content

Commit

Permalink
protect against negative sized tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhillman committed Jul 12, 2019
1 parent 9e9e461 commit 395aa4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfTiledInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ readTileData (InputStreamMutex *streamData,
if (levelY != ly)
throw IEX_NAMESPACE::InputExc ("Unexpected tile y level number coordinate.");

if (dataSize > (int) ifd->tileBufferSize)
if (dataSize < 0 || dataSize > static_cast<int>(ifd->tileBufferSize) )
throw IEX_NAMESPACE::InputExc ("Unexpected tile block length.");

//
Expand Down

0 comments on commit 395aa4c

Please sign in to comment.