Skip to content

Commit

Permalink
Fix overflow computing deeptile sample table size (AcademySoftwareFou…
Browse files Browse the repository at this point in the history
…ndation#861)


Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
  • Loading branch information
peterhillman authored and cary-ilm committed May 12, 2021
1 parent 2eaa954 commit 8bdbfff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,8 @@ DeepTiledInputFile::initialize ()
for (size_t i = 0; i < _data->tileBuffers.size(); i++)
_data->tileBuffers[i] = new TileBuffer ();

_data->maxSampleCountTableSize = _data->tileDesc.ySize *
_data->tileDesc.xSize *
_data->maxSampleCountTableSize = static_cast<size_t>(_data->tileDesc.ySize) *
static_cast<size_t>(_data->tileDesc.xSize) *
sizeof(int);

_data->sampleCountTableBuffer.resizeErase(_data->maxSampleCountTableSize);
Expand Down

0 comments on commit 8bdbfff

Please sign in to comment.