Skip to content

Commit

Permalink
address AcademySoftwareFoundation#271: catch scanlines with negative …
Browse files Browse the repository at this point in the history
…sizes
  • Loading branch information
peterhillman committed Jul 12, 2019
1 parent 700e499 commit 7031360
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 7031360

Please sign in to comment.