From 4e597c8fd5d604273266ea19a1074a2c870ba224 Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 7 Nov 2016 15:16:01 -0800 Subject: Force compiler to deduce src type for checked_cast. Otherwise, we might be silently doing an unsafe cast before applying the check if the actual argument doesn't match the exact src type. Review-Url: https://codereview.chromium.org/2484953003 --- core/fpdfapi/parser/cpdf_parser.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'core/fpdfapi') diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp index cf23ec7cd7..ed20cf73f4 100644 --- a/core/fpdfapi/parser/cpdf_parser.cpp +++ b/core/fpdfapi/parser/cpdf_parser.cpp @@ -1015,10 +1015,8 @@ bool CPDF_Parser::LoadCrossRefV5(FX_FILESIZE* pos, bool bMainXRef) { if (startnum < 0) continue; - m_dwXrefStartObjNum = - pdfium::base::checked_cast(startnum); - uint32_t count = - pdfium::base::checked_cast(arrIndex[i].second); + m_dwXrefStartObjNum = pdfium::base::checked_cast(startnum); + uint32_t count = pdfium::base::checked_cast(arrIndex[i].second); FX_SAFE_UINT32 dwCaculatedSize = segindex; dwCaculatedSize += count; dwCaculatedSize *= totalWidth; -- cgit v1.2.3