summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoxit <jun_fang@foxitsoftware.com>2014-06-20 17:07:21 -0700
committerfoxit <jun_fang@foxitsoftware.com>2014-06-20 17:07:21 -0700
commit617089a3c1409be11fa130abb78dbd00b9e32d06 (patch)
tree2b90e116df5e4ed1e9dd53f17d15d2b812d5372a
parentbda823275ac5a54d688a62e15d406b502b317973 (diff)
downloadpdfium-617089a3c1409be11fa130abb78dbd00b9e32d06.tar.xz
BUG=382241
R=palmer@chromium.org Review URL: https://codereview.chromium.org/331123002
-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;