diff options
author | tsepez <tsepez@chromium.org> | 2016-08-19 15:48:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-19 15:48:05 -0700 |
commit | 68624257bf300036a3898015eee718a6026ca6f5 (patch) | |
tree | 14f7c47437d2fd8b44050f8bd975d85cb8d7df54 /core/fpdfapi/fpdf_font | |
parent | a752edfd2ddc4913aeffd31b67f6fdb53e4116ae (diff) | |
download | pdfium-68624257bf300036a3898015eee718a6026ca6f5.tar.xz |
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
Diffstat (limited to 'core/fpdfapi/fpdf_font')
-rw-r--r-- | core/fpdfapi/fpdf_font/fpdf_font.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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)); |