Merge cherrypicks of [2890126, 2889507, 2890138, 2890127, 2890128, 2891029, 2891030, 2891031, 2891032, 2891033, 2891034, 2891036, 2891037, 2891038, 2891039, 2891040, 2890763, 2890764, 2890765, 2890766, 2890767, 2890768, 2891129, 2891130, 2891131, 2890139, 2890140, 2890141, 2890142, 2890143, 2890144, 2890145, 2890536, 2891066, 2890146, 2891133, 2891134, 2891135, 2891452, 2891453, 2891454, 2891455, 2891456, 2891457, 2891458, 2890150, 2890151, 2891459, 2891460, 2891461, 2891462, 2891633, 2891638, 2891639, 2891790, 2891808, 2891849, 2891850, 2891759, 2891760, 2891929, 2891930, 2891643, 2891743, 2891716] into nyc-bugfix-release

Change-Id: Id21d4e40aac66684bc89466b63ec95a50fb42dee
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;
 		
 		}