summaryrefslogtreecommitdiff
path: root/third_party/base/numerics
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-05-21 15:08:17 -0700
committerTom Sepez <tsepez@chromium.org>2015-05-21 15:08:17 -0700
commit5f566b3e5cbbcab6c0c1b37ca09046081b9bb94c (patch)
tree94eb924cbb458faedae676e216b0f1e42350ca1d /third_party/base/numerics
parente6406b39d09f765f5f1a1530a3a737f17a0666c1 (diff)
downloadpdfium-5f566b3e5cbbcab6c0c1b37ca09046081b9bb94c.tar.xz
Update copy of safe_math_impl.h to take a fix from upstream:
Fix a division by zero when multiplying 0 * y with SafeNumerics. BUG=488302 R=jschuh@chromium.org Review URL: https://codereview.chromium.org/1126243007
Diffstat (limited to 'third_party/base/numerics')
-rw-r--r--third_party/base/numerics/safe_math_impl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/third_party/base/numerics/safe_math_impl.h b/third_party/base/numerics/safe_math_impl.h
index f9a4a71570..14897202bd 100644
--- a/third_party/base/numerics/safe_math_impl.h
+++ b/third_party/base/numerics/safe_math_impl.h
@@ -178,8 +178,8 @@ typename enable_if<std::numeric_limits<T>::is_integer&& std::numeric_limits<
T>::is_signed&&(sizeof(T) * 2 > sizeof(uintmax_t)),
T>::type
CheckedMul(T x, T y, RangeConstraint* validity) {
- // if either side is zero then the result will be zero.
- if (!(x || y)) {
+ // If either side is zero then the result will be zero.
+ if (!x || !y) {
return RANGE_VALID;
} else if (x > 0) {