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/fpdfdoc/cpdf_formfield.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/fpdfdoc') diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp index e2240c9f2f..8170b7fcbf 100644 --- a/core/fpdfdoc/cpdf_formfield.cpp +++ b/core/fpdfdoc/cpdf_formfield.cpp @@ -682,7 +682,7 @@ int CPDF_FormField::InsertOption(CFX_WideString csOptLabel, m_pDict->SetFor("Opt", pOpt); } - int iCount = pdfium::base::checked_cast(pOpt->GetCount()); + int iCount = pdfium::base::checked_cast(pOpt->GetCount()); if (index >= iCount) { pOpt->AddString(csStr); index = iCount; -- cgit v1.2.3