From ae180248fdc1abcd10f782c8e32b77a62594d349 Mon Sep 17 00:00:00 2001 From: Just Date: Sat, 13 Jan 2001 13:48:30 +0000 Subject: [PATCH] workaround for currupt (?) cmap subtable git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@128 4cde692c-a291-49d1-8350-778aa11640f8 --- Lib/fontTools/ttLib/tables/_c_m_a_p.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/fontTools/ttLib/tables/_c_m_a_p.py b/Lib/fontTools/ttLib/tables/_c_m_a_p.py index d6fdfe78c..c6d237e15 100644 --- a/Lib/fontTools/ttLib/tables/_c_m_a_p.py +++ b/Lib/fontTools/ttLib/tables/_c_m_a_p.py @@ -24,6 +24,8 @@ class table__c_m_a_p(DefaultTable.DefaultTable): ">HHl", data[4+i*8:4+(i+1)*8]) platformID, platEncID = int(platformID), int(platEncID) format, length = struct.unpack(">HH", data[offset:offset+4]) + if not length: + continue # bogus cmap subtable? if not cmap_classes.has_key(format): table = cmap_format_unknown(format) else: