BUG=382241
authorfoxit <jun_fang@foxitsoftware.com>
Sat, 21 Jun 2014 00:07:21 +0000 (17:07 -0700)
committerfoxit <jun_fang@foxitsoftware.com>
Sat, 21 Jun 2014 00:07:21 +0000 (17:07 -0700)
R=palmer@chromium.org

Review URL: https://codereview.chromium.org/331123002

core/src/fpdfapi/fpdf_font/fpdf_font.cpp

index 4bec333..72b8adb 100644 (file)
@@ -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;