Skip to content

Commit

Permalink
address #271: catch scanlines with negative sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhillman committed Jul 15, 2019
1 parent 960a56f commit 849c616
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfScanLineInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ readPixelData (InputStreamMutex *streamData,
if (yInFile != minY)
throw IEX_NAMESPACE::InputExc ("Unexpected data block y coordinate.");

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

//
// Read the pixel data.
Expand Down

0 comments on commit 849c616

Please sign in to comment.