Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: core/src/fxge/ge/fx_ge_fontmap.cpp

Issue 317203003: Fix a crash when parsing truetype fonts without any tables. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/ge/fx_ge_fontmap.cpp
diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp
index 8c2751d84acd872f12cb2e61aa0e8d19ce108322..1b47f1ff14363a9b834e2fc5382e2feedf27a6e3 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698