From 68624257bf300036a3898015eee718a6026ca6f5 Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 19 Aug 2016 15:48:05 -0700 Subject: Avoid signed overflow in CPDF_ToUnicodeMap::StringToCode() It was intended to be unsigned in the first place, and we're perfectly happy with the overflow as long as it is no longer undefined behaviour. BUG=638489 Review-Url: https://codereview.chromium.org/2258053003 --- core/fpdfapi/fpdf_font/fpdf_font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/fpdfapi/fpdf_font/fpdf_font.cpp b/core/fpdfapi/fpdf_font/fpdf_font.cpp index a14c43d4fa..1cb67be51f 100644 --- a/core/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/fpdfapi/fpdf_font/fpdf_font.cpp @@ -135,7 +135,7 @@ uint32_t CPDF_ToUnicodeMap::StringToCode(const CFX_ByteStringC& str) { if (len == 0) return 0; - int result = 0; + uint32_t result = 0; if (str[0] == '<') { for (int i = 1; i < len && std::isxdigit(str[i]); ++i) result = result * 16 + FXSYS_toHexDigit(str.CharAt(i)); -- cgit v1.2.3