From 617089a3c1409be11fa130abb78dbd00b9e32d06 Mon Sep 17 00:00:00 2001 From: foxit Date: Fri, 20 Jun 2014 17:07:21 -0700 Subject: BUG=382241 R=palmer@chromium.org Review URL: https://codereview.chromium.org/331123002 --- core/src/fpdfapi/fpdf_font/fpdf_font.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; -- cgit v1.2.3