Skip to content

Commit e69bf4b

Browse files
cary-ilmpeterhillman
authored andcommitted
Report an error if a deep pixel as more than UINT_MAX samples (#2256)
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
1 parent 59fe81b commit e69bf4b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/OpenEXR/ImfCompositeDeepScanLine.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ CompositeDeepScanLine::readPixels (int start, int end)
519519
num_sources[ptr] = 0;
520520
for (size_t j = 0; j < parts; j++)
521521
{
522+
if (total_sizes[ptr] > std::numeric_limits<unsigned int>::max() - counts[j][ptr])
523+
throw IEX_NAMESPACE::ArgExc (
524+
"Cannot composite scanline: pixel cannot have more than UINT_MAX samples");
525+
522526
total_sizes[ptr] += counts[j][ptr];
523527
if (counts[j][ptr] > 0) num_sources[ptr]++;
524528
}

0 commit comments

Comments
 (0)