summaryrefslogtreecommitdiff
path: root/core/fxcodec
diff options
context:
space:
mode:
authortracy_jiang <tracy_jiang@foxitsoftware.com>2016-08-29 13:42:56 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-29 13:42:56 -0700
commitdda2c0dc502b50d4de66b80305441bfb612ec6c1 (patch)
treefaf28f1b1f12ad9cd41473fa71bdad70c6f361e9 /core/fxcodec
parentc116e597ef4dfac88248d6de0e7c9bdf093b6e7c (diff)
downloadpdfium-dda2c0dc502b50d4de66b80305441bfb612ec6c1.tar.xz
Fix for #618267. Adding a method to determine if multiplication has
overflow. BUG=618267 Review-Url: https://codereview.chromium.org/2284063002
Diffstat (limited to 'core/fxcodec')
-rw-r--r--core/fxcodec/codec/fx_codec_tiff.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/fxcodec/codec/fx_codec_tiff.cpp b/core/fxcodec/codec/fx_codec_tiff.cpp
index 09cfea4111..20fda6308f 100644
--- a/core/fxcodec/codec/fx_codec_tiff.cpp
+++ b/core/fxcodec/codec/fx_codec_tiff.cpp
@@ -79,6 +79,10 @@ int _TIFFmemcmp(const void* ptr1, const void* ptr2, tmsize_t size) {
return FXSYS_memcmp(ptr1, ptr2, (size_t)size);
}
+int _TIFFIfMultiplicationOverflow(tmsize_t op1, tmsize_t op2) {
+ return op1 > std::numeric_limits<tmsize_t>::max() / op2;
+}
+
TIFFErrorHandler _TIFFwarningHandler = nullptr;
TIFFErrorHandler _TIFFerrorHandler = nullptr;