diff options
author | npm <npm@chromium.org> | 2016-10-04 13:00:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-04 13:00:37 -0700 |
commit | 1c4b767e822a7537f2c6c19b42dddce840e033ee (patch) | |
tree | 80cc15996d0be9f757702e5fd5f4b1cc715593be /core/fpdfapi/font/font_int.h | |
parent | fb403875dd1bbf830d9325f10e6a5650db30c6fd (diff) | |
download | pdfium-1c4b767e822a7537f2c6c19b42dddce840e033ee.tar.xz |
Avoid crashing on CPDF_ToUnicodeMap::Load by using ValueOrDefault()
- Added private method to avoid duplicated code.
- If the unicode calculation overflows, 0 is used instead of crashing.
Review-Url: https://codereview.chromium.org/2392103002
Diffstat (limited to 'core/fpdfapi/font/font_int.h')
-rw-r--r-- | core/fpdfapi/font/font_int.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/fpdfapi/font/font_int.h b/core/fpdfapi/font/font_int.h index 10c2dcada4..02131eb67c 100644 --- a/core/fpdfapi/font/font_int.h +++ b/core/fpdfapi/font/font_int.h @@ -196,6 +196,8 @@ class CPDF_ToUnicodeMap { static uint32_t StringToCode(const CFX_ByteStringC& str); static CFX_WideString StringToWideString(const CFX_ByteStringC& str); + uint32_t GetUnicode(); + std::map<uint32_t, uint32_t> m_Map; CPDF_CID2UnicodeMap* m_pBaseMap; CFX_WideTextBuf m_MultiCharBuf; |