Skip to content

Commit

Permalink
Make sure to skip over slices that will only be filled when computing…
Browse files Browse the repository at this point in the history
… the uncompressed pixel size. Otherwise chunks that compressed to larger sizes than the original will fail to load.
  • Loading branch information
Halfdan Ingvarsson authored and kdt3rd committed Jul 25, 2019
1 parent 8b5370c commit 14905ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ TileBufferTask::execute ()
int count = _ifd->getSampleCount(x - xOffset, y - yOffset);
for (unsigned int c = 0; c < _ifd->slices.size(); ++c)
{
// This slice does not exist in the file.
if (_ifd->slices[c]->fill)
continue;

sizeOfTile += count * pixelTypeSize(_ifd->slices[c]->typeInFile);
bytesPerLine += count * pixelTypeSize(_ifd->slices[c]->typeInFile);
}
Expand Down

0 comments on commit 14905ee

Please sign in to comment.