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
parent 07952e83
...@@ -21,7 +21,7 @@ vars = { ...@@ -21,7 +21,7 @@ vars = {
"libjingle_revision": "77", "libjingle_revision": "77",
"libvpx_revision": "90416", "libvpx_revision": "90416",
"ffmpeg_revision": "96257", "ffmpeg_revision": "96257",
"sfntly_revision": "36", "sfntly_revision": "43",
"skia_revision": "2088", "skia_revision": "2088",
"v8_revision": "8765", "v8_revision": "8765",
"webrtc_revision": "242", "webrtc_revision": "242",
......
...@@ -154,6 +154,9 @@ bool SubsetterImpl::HasName(const char* font_name, Font* font) { ...@@ -154,6 +154,9 @@ bool SubsetterImpl::HasName(const char* font_name, Font* font) {
typedef std::map<int32_t, UnicodeString> NameMap; typedef std::map<int32_t, UnicodeString> NameMap;
NameMap names; NameMap names;
NameTablePtr name_table = down_cast<NameTable*>(font->GetTable(Tag::name)); 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) { for (int32_t i = 0; i < name_table->NameCount(); ++i) {
switch(name_table->NameId(i)) { switch(name_table->NameId(i)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment