summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYujie Qin <yujieqin@google.com>2017-05-15 09:52:31 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-15 09:52:31 +0000
commitb1ab59449f7fd1bda1b7ef43b63889a2434dcbb5 (patch)
treed49fb775bdf32dcb66fe70a228c476446d4fbe31
parent0420a20d94d620f471e47cf3f8c40facca5de58e (diff)
parent5e702072c8012638e4356eb2e62f5f8f910bd01d (diff)
downloaddng_sdk-b1ab59449f7fd1bda1b7ef43b63889a2434dcbb5.tar.gz
Throw exception on integer overflow in dng_ifd.cpp.
am: 5e702072c8 Change-Id: I386454c815b42390c36daa4b9e12032f052ef939
-rw-r--r--source/dng_ifd.cpp4
1 files changed, 2 insertions, 2 deletions
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 @@ uint32 dng_ifd::TilesAcross () const
if (fTileWidth)
{
- return (fImageWidth + fTileWidth - 1) / fTileWidth;
+ return (SafeUint32Sub(SafeUint32Add(fImageWidth, fTileWidth), 1)) / fTileWidth;
}
@@ -3995,7 +3995,7 @@ uint32 dng_ifd::TilesDown () const
if (fTileLength)
{
- return (fImageLength + fTileLength - 1) / fTileLength;
+ return (SafeUint32Sub(SafeUint32Add(fImageLength, fTileLength), 1)) / fTileLength;
}