Skip to content

Commit ac450ad

Browse files
authored
Merge branch 'main' into uncompressed_verify
2 parents 8a599bd + 556e056 commit ac450ad

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/lib/OpenEXRCore/parse_header.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2492,7 +2492,9 @@ internal_exr_compute_chunk_offset_size (exr_priv_part_t curpart)
24922492

24932493
w = (uint64_t) (((int64_t) dw.max.x) - ((int64_t) dw.min.x) + 1);
24942494

2495-
if (curpart->tiles)
2495+
if (curpart->storage_mode != EXR_STORAGE_SCANLINE &&
2496+
curpart->storage_mode != EXR_STORAGE_DEEP_SCANLINE &&
2497+
curpart->tiles)
24962498
{
24972499
const exr_attr_tiledesc_t* tiledesc = curpart->tiles->tiledesc;
24982500
int64_t tilecount = 0;

src/lib/OpenEXRUtil/ImfCheckFile.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,24 @@ readDeepTile (T& in, bool reduceMemory, bool reduceTime)
694694
try
695695
{
696696

697+
697698
in.readPixelSampleCounts (
698699
x, y, x, y, xlevel, ylevel);
699700

700701
size_t bufferSize = 0;
701702
size_t fileBufferSize = 0;
702703

703-
for (int ty = 0; ty < tileHeight; ++ty)
704+
Box2i tileRange =
705+
in.dataWindowForTile (x, y, xlevel, ylevel);
706+
707+
int thisTileWidth =
708+
tileRange.max.x - tileRange.min.x + 1;
709+
int thisTileHeight =
710+
tileRange.max.y - tileRange.min.y + 1;
711+
712+
for (int ty = 0; ty < thisTileHeight; ++ty)
704713
{
705-
for (int tx = 0; tx < tileWidth; ++tx)
714+
for (int tx = 0; tx < thisTileWidth; ++tx)
706715
{
707716
fileBufferSize +=
708717
channelCount *
@@ -731,9 +740,10 @@ readDeepTile (T& in, bool reduceMemory, bool reduceTime)
731740
pixelBuffer.resize (bufferSize);
732741
size_t bufferIndex = 0;
733742

734-
for (int ty = 0; ty < tileHeight; ++ty)
743+
for (int ty = 0; ty < thisTileHeight; ++ty)
735744
{
736-
for (int tx = 0; tx < tileWidth; ++tx)
745+
for (int tx = 0; tx < thisTileWidth;
746+
++tx)
737747
{
738748
if (!reduceMemory ||
739749
localSampleCount[ty][tx] *

0 commit comments

Comments
 (0)