Skip to content

Commit

Permalink
fix static_cast to allow subtraction of negative min.x and min.y values
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldsmith committed Jan 26, 2025
1 parent d11a344 commit e29ac5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/IlmImfCtl/ImfCtlApplyTransforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ applyTransforms
// Determine how many samples we will process.
//

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

if (totalSamples <= 0)
return;
Expand Down

0 comments on commit e29ac5d

Please sign in to comment.