Skip to content

Commit

Permalink
fixed comment
Browse files Browse the repository at this point in the history
Signed-off-by: Cary Phillips <[email protected]>
  • Loading branch information
cary-ilm committed Aug 9, 2020
1 parent 1a1e13f commit 6bb6257
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions OpenEXR/IlmImf/ImfHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,14 @@ void checkIsNullTerminated (const char (&str)[N], const char *what)
void
sanityCheckDisplayWindow (int width, int height)
{
if (width <= 0 || height <= 0)
{
// Note that if width == -INT_MAX the width-1 below will
// overflow, so better to catch that case here.
//
// Ensure a valid displayWindow. All values for which width-1 < 0
// are invalid, but in particular, note that if width=-INT_MAX,
// width-1 will overflow.
//

if (width < 1 || height < 1)
throw IEX_NAMESPACE::ArgExc ("Invalid display window in image header.");
}
}

} // namespace
Expand Down

0 comments on commit 6bb6257

Please sign in to comment.