From b5cabcb3b24f835cb09c7086b380be2b26cf46be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Pe=C3=B1a?= Date: Tue, 10 Jul 2018 15:50:56 +0000 Subject: Fix m_ExtGID usage in CPDF_CharPosList MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Commit-Queue: Nicolás Peña Moreno --- core/fpdfapi/render/cpdf_charposlist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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& 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(-1) + ? charpos.m_ExtGID + : charpos.m_GlyphIndex; #endif CFX_Font* pCurrentFont; if (GlyphID != static_cast(-1)) { -- cgit v1.2.3