summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_simplefont.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/font/cpdf_simplefont.cpp')
-rw-r--r--core/fpdfapi/font/cpdf_simplefont.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/fpdfapi/font/cpdf_simplefont.cpp b/core/fpdfapi/font/cpdf_simplefont.cpp
index a3597824bd..cb8f00a98a 100644
--- a/core/fpdfapi/font/cpdf_simplefont.cpp
+++ b/core/fpdfapi/font/cpdf_simplefont.cpp
@@ -29,8 +29,11 @@ int CPDF_SimpleFont::GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) {
if (charcode > 0xff)
return -1;
- int index = m_GlyphIndex[(uint8_t)charcode];
- return index != 0xffff ? index : -1;
+ int index = m_GlyphIndex[charcode];
+ if (index == 0xffff || (index == 0 && IsTrueTypeFont()))
+ return -1;
+
+ return index;
}
void CPDF_SimpleFont::LoadCharMetrics(int charcode) {