diff options
author | Nicolás Peña <npm@chromium.org> | 2018-07-10 15:50:56 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-10 15:50:56 +0000 |
commit | b5cabcb3b24f835cb09c7086b380be2b26cf46be (patch) | |
tree | 08bade2f54c336ec3a6a6d087e00dd11f443b015 | |
parent | c9297e896c697b5bb9c3b9e66791a834f5552170 (diff) | |
download | pdfium-b5cabcb3b24f835cb09c7086b380be2b26cf46be.tar.xz |
Fix m_ExtGID usage in CPDF_CharPosList
This CL allows Apple to use m_GlyphIndex as a replacement for m_ExtGID
when it is invalid.
Bug: pdfium:1121
Change-Id: I49e7936201815bae5a2c8a26680fc1e542a60c43
Reviewed-on: https://pdfium-review.googlesource.com/37390
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
-rw-r--r-- | core/fpdfapi/render/cpdf_charposlist.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/fpdfapi/render/cpdf_charposlist.cpp b/core/fpdfapi/render/cpdf_charposlist.cpp index ddb215c48b..7c0e28875c 100644 --- a/core/fpdfapi/render/cpdf_charposlist.cpp +++ b/core/fpdfapi/render/cpdf_charposlist.cpp @@ -41,7 +41,9 @@ void CPDF_CharPosList::Load(const std::vector<uint32_t>& charCodes, uint32_t GlyphID = charpos.m_GlyphIndex; #if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ charpos.m_ExtGID = pFont->GlyphFromCharCodeExt(CharCode); - GlyphID = charpos.m_ExtGID; + GlyphID = charpos.m_ExtGID != static_cast<uint32_t>(-1) + ? charpos.m_ExtGID + : charpos.m_GlyphIndex; #endif CFX_Font* pCurrentFont; if (GlyphID != static_cast<uint32_t>(-1)) { |