summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYujie Qin <yujieqin@google.com>2017-05-15 09:55:22 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-15 09:55:22 +0000
commit8526cf49d2d3bddea02b42c29a20e615110927c3 (patch)
tree8557d447a311d7f212218b9c52cf342b7d3ce08a
parentdb570e5785b42bca84779865ae2064e51915f65e (diff)
parentc15827de68e3ce4a2ab51ffbf7f0884760e3a46d (diff)
downloaddng_sdk-8526cf49d2d3bddea02b42c29a20e615110927c3.tar.gz
Throw exception on integer overflow in dng_ifd.cpp. am: 1cc3bdb6e1
am: c15827de68 Change-Id: I2916112f7a9447d75ebf5c5e27daf9359f768354
-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;
}