From 4022f87eb8716155291543efaaf289e51d7cbf43 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 23 Jan 2017 14:36:20 -0800 Subject: Update safe numerics package to get bitwise ops Fix callers conventions to avoid ambiguity. Fix bad bounds check unmasked by change. Directly include headers no longer pulled in by numerics itself. Review-Url: https://codereview.chromium.org/2640143003 --- core/fxge/ge/cfx_renderdevice.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/fxge/ge/cfx_renderdevice.cpp') diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp index 9c67a7d1e7..0e6a4e74af 100644 --- a/core/fxge/ge/cfx_renderdevice.cpp +++ b/core/fxge/ge/cfx_renderdevice.cpp @@ -1022,13 +1022,15 @@ bool CFX_RenderDevice::DrawNormalText(int nChars, bool bBGRStripe = !!(text_flags & FXTEXT_BGR_STRIPE); ncols /= 3; int x_subpixel = (int)(glyph.m_fOriginX * 3) % 3; - int start_col = std::max(left.ValueOrDie(), 0); + int start_col = + pdfium::base::ValueOrDieForType(pdfium::base::CheckMax(left, 0)); pdfium::base::CheckedNumeric end_col_safe = left; end_col_safe += ncols; if (!end_col_safe.IsValid()) return false; - int end_col = std::min(end_col_safe.ValueOrDie(), dest_width); + int end_col = + std::min(static_cast(end_col_safe.ValueOrDie()), dest_width); if (start_col >= end_col) continue; -- cgit v1.2.3