diff options
author | arthurhsu@chromium.org <arthurhsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 11:31:17 +0000 |
---|---|---|
committer | arthurhsu@chromium.org <arthurhsu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-11 11:31:17 +0000 |
commit | 8323415b9e69f7bcfdc3bc75558e55a18eaa8d32 (patch) | |
tree | f03ec636f311abfdd9b4b35e748785cd6a503bfd /third_party/sfntly | |
parent | 07952e8320ed26779e2a46eeb3e3ed90a3f48efa (diff) | |
download | chromium_src-8323415b9e69f7bcfdc3bc75558e55a18eaa8d32.zip chromium_src-8323415b9e69f7bcfdc3bc75558e55a18eaa8d32.tar.gz chromium_src-8323415b9e69f7bcfdc3bc75558e55a18eaa8d32.tar.bz2 |
Fortify against corrupted font.
BUG=92270
TEST=none
Review URL: http://codereview.chromium.org/7610005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/sfntly')
-rw-r--r-- | third_party/sfntly/src/subsetter/subsetter_impl.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/third_party/sfntly/src/subsetter/subsetter_impl.cc b/third_party/sfntly/src/subsetter/subsetter_impl.cc index 4d4b0ff..217bd12a 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)) { |