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

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

Issue 1763493003: Check that the names buffer is not empty before passing to GetNameFromTT. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 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 06b58ea3abc89218be842397200844985c82b89f..890de616d1c6d2c5bcc8c5e07688d7c7e1f24e7c 100644
--- a/core/src/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/src/fxge/ge/fx_ge_fontmap.cpp
@@ -1421,6 +1421,9 @@ void CFX_FolderFontInfo::ReportFace(const CFX_ByteString& path,
}
CFX_ByteString names =
FPDF_LoadTableFromTT(pFile, tables, nTables, 0x6e616d65);
+ if (names.IsEmpty()) {
+ return;
+ }
CFX_ByteString facename = GetNameFromTT(names, 1);
CFX_ByteString style = GetNameFromTT(names, 2);
if (style != "Regular") {
« 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