diff options
author | Lei Zhang <thestig@chromium.org> | 2014-06-09 12:16:58 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2014-06-09 12:16:58 -0700 |
commit | 9364d22602a3db1e8f25b3e14310948857f2b54d (patch) | |
tree | bbaa5f75a7d48c1a2806067132e8ea5bfc3ae982 /core/src | |
parent | 0db35e84407fe41f1ba9c19628a9fcfc9cc8f462 (diff) | |
download | pdfium-9364d22602a3db1e8f25b3e14310948857f2b54d.tar.xz |
Fix a crash when parsing truetype fonts without any tables.
BUG=chromium:381011
R=bo_xu@foxitsoftware.com
Review URL: https://codereview.chromium.org/317203003
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fxge/ge/fx_ge_fontmap.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index 8c2751d84a..1b47f1ff14 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -1428,6 +1428,9 @@ void CFX_FolderFontInfo::ReportFace(CFX_ByteString& path, FXSYS_FILE* pFile, FX_ } FX_DWORD nTables = GET_TT_SHORT(buffer + 4); CFX_ByteString tables = _FPDF_ReadStringFromFile(pFile, nTables * 16); + if (tables.IsEmpty()) { + return; + } CFX_ByteString names = _FPDF_LoadTableFromTT(pFile, tables, nTables, 0x6e616d65); CFX_ByteString facename = _FPDF_GetNameFromTT(names, 1); CFX_ByteString style = _FPDF_GetNameFromTT(names, 2); |