Skip to content

Commit

Permalink
Merge ABI-compatible changes from AcademySoftwareFoundation#842
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
  • Loading branch information
peterhillman committed Dec 7, 2020
1 parent e0af7a8 commit 23170c8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions OpenEXR/IlmImf/ImfDeepScanLineInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,12 @@ LineBufferTask::execute ()

int width = (_ifd->maxX - _ifd->minX + 1);

ptrdiff_t base = reinterpret_cast<ptrdiff_t>(&_ifd->sampleCount[0][0]);
base -= sizeof(unsigned int)*_ifd->minX;
base -= sizeof(unsigned int)*static_cast<ptrdiff_t>(_ifd->minY) * static_cast<ptrdiff_t>(width);

copyIntoDeepFrameBuffer (readPtr, slice.base,
(char*) (&_ifd->sampleCount[0][0]
- _ifd->minX
- _ifd->minY * width),
reinterpret_cast<char*>(base),
sizeof(unsigned int) * 1,
sizeof(unsigned int) * width,
y, _ifd->minX, _ifd->maxX,
Expand Down
2 changes: 1 addition & 1 deletion OpenEXR/IlmImf/ImfInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ bufferedReadPixels (InputFile::Data* ifd, int scanLine1, int scanLine2)
// if no channels are being read that are present in file, cachedBuffer will be empty
//

if (ifd->cachedBuffer->begin() != ifd->cachedBuffer->end())
if (ifd->cachedBuffer && ifd->cachedBuffer->begin() != ifd->cachedBuffer->end())
{
ifd->tFile->readTiles (0, ifd->tFile->numXTiles (0) - 1, j, j);
}
Expand Down
5 changes: 4 additions & 1 deletion OpenEXR/IlmImf/ImfTiledInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,10 @@ TiledInputFile::initialize ()
{
if (!isTiled (_data->version))
throw IEX_NAMESPACE::ArgExc ("Expected a tiled file but the file is not tiled.");


if (isNonImage (_data->version))
throw IEX_NAMESPACE::ArgExc ("File is not a regular tiled image.");

}
else
{
Expand Down

0 comments on commit 23170c8

Please sign in to comment.