Merge cherrypicks of [2337407, 2337461, 2337391, 2337257, 2337318, 2337340, 2337423, 2337481, 2337412, 2337521, 2337413, 2337426, 2337414, 2337415, 2337523, 2337502, 2337503, 2337524, 2337463, 2337483, 2337417, 2337427, 2337561, 2337464, 2337581, 2337484, 2337525, 2337526, 2337527, 2337394, 2337562, 2337528, 2337504, 2337563, 2337565, 2337584, 2337602, 2337530, 2337585, 2337532, 2337487, 2337396, 2337505, 2337432, 2337603, 2337604, 2337534, 2337536, 2337508, 2337606] into nyc-mr1-volantis-release

Change-Id: Ic29691ad8d7e8a1bb2c7f4e58cfbb2a497794f6f
diff --git a/source/dng_ifd.cpp b/source/dng_ifd.cpp
index 317ebf9..7f22065 100644
--- a/source/dng_ifd.cpp
+++ b/source/dng_ifd.cpp
@@ -3979,7 +3979,7 @@
 	if (fTileWidth)
 		{
 
-		return (fImageWidth + fTileWidth - 1) / fTileWidth;
+		return (SafeUint32Sub(SafeUint32Add(fImageWidth, fTileWidth), 1)) / fTileWidth;
 		
 		}
 		
@@ -3995,7 +3995,7 @@
 	if (fTileLength)
 		{
 
-		return (fImageLength + fTileLength - 1) / fTileLength;
+		return (SafeUint32Sub(SafeUint32Add(fImageLength, fTileLength), 1)) / fTileLength;
 		
 		}