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

Unified Diff: third_party/sfntly/src/subsetter/subsetter_impl.cc

Issue 7610005: Fortify against corrupted font. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update to resolve DEPS conflict Created 9 years, 4 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 | « DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sfntly/src/subsetter/subsetter_impl.cc
diff --git a/third_party/sfntly/src/subsetter/subsetter_impl.cc b/third_party/sfntly/src/subsetter/subsetter_impl.cc
index 4d4b0ff10e2ae67c0c2ccb1aa3d980bae76f669e..217bd12a44bcbd0a7cace6390d5f85822fedf4b1 100644
--- a/third_party/sfntly/src/subsetter/subsetter_impl.cc
+++ b/third_party/sfntly/src/subsetter/subsetter_impl.cc
@@ -154,6 +154,9 @@ bool SubsetterImpl::HasName(const char* font_name, Font* font) {
typedef std::map<int32_t, UnicodeString> NameMap;
NameMap names;
NameTablePtr name_table = down_cast<NameTable*>(font->GetTable(Tag::name));
+ if (name_table == NULL) {
+ return false;
+ }
for (int32_t i = 0; i < name_table->NameCount(); ++i) {
switch(name_table->NameId(i)) {
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698