summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 4bec3337b1..72b8adbe20 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -1464,6 +1464,9 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
&& m_pCharNames == NULL) || (m_Flags & PDFFONT_NONSYMBOLIC)) {
if (!FXFT_Has_Glyph_Names(m_Font.m_Face) && (!m_Font.m_Face->num_charmaps || !m_Font.m_Face->charmaps)) {
int nStartChar = m_pFontDict->GetInteger(FX_BSTRC("FirstChar"));
+ if(nStartChar < 0 || nStartChar > 255)
+ return;
+
int charcode = 0;
for (; charcode < nStartChar; charcode ++) {
m_GlyphIndex[charcode] = 0;