From 46833b0e090a31cdccc32cad1ca27fe601d79875 Mon Sep 17 00:00:00 2001
From: Cary Phillips <cary@ilm.com>
Date: Sat, 8 Aug 2020 16:34:02 -0700
Subject: [PATCH] Change >= to > in overflow calculation

Signed-off-by: Cary Phillips <cary@ilm.com>
---
 IlmImf/ImfTiledMisc.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/IlmImf/ImfTiledMisc.cpp b/IlmImf/ImfTiledMisc.cpp
index 1cff8037d..51b6e5c26 100644
--- a/IlmImf/ImfTiledMisc.cpp
+++ b/IlmImf/ImfTiledMisc.cpp
@@ -301,11 +301,11 @@ calculateNumTiles (int *numTiles,
 {
     for (int i = 0; i < numLevels; i++)
     {
-	int l = levelSize (min, max, i, rmode);
-        if (l >= std::numeric_limits<int>::max() - size + 1)
+        int l = levelSize (min, max, i, rmode);
+        if (l > std::numeric_limits<int>::max() - size + 1)
             throw IEX_NAMESPACE::ArgExc ("Invalid size.");
 
-	numTiles[i] = (l + size - 1) / size;
+        numTiles[i] = (l + size - 1) / size;
     }
 }
 
