Skip to content

Commit e29ac5d

Browse files
committed
fix static_cast to allow subtraction of negative min.x and min.y values
1 parent d11a344 commit e29ac5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/IlmImfCtl/ImfCtlApplyTransforms.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ applyTransforms
487487
// Determine how many samples we will process.
488488
//
489489

490-
size_t totalSamples = (static_cast<size_t>(transformWindow.max.x) - static_cast<size_t>(transformWindow.min.x + 1)) *
491-
(static_cast<size_t>(transformWindow.max.y) - static_cast<size_t>(transformWindow.min.y + 1));
490+
size_t totalSamples = static_cast<size_t>(transformWindow.max.x - transformWindow.min.x + 1) *
491+
static_cast<size_t>(transformWindow.max.y - transformWindow.min.y + 1);
492492

493493
if (totalSamples <= 0)
494494
return;

0 commit comments

Comments
 (0)