otTables: fix IndexError while pruning of HVAR pre-write

This commit is contained in:
Cosimo Lupo 2018-04-03 10:26:18 +01:00
parent a523a69716
commit 6b6c34ab1a
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482

View File

@ -562,7 +562,7 @@ class VarIdxMap(BaseTable):
glyphOrder = font.getGlyphOrder()
mapping = [mapping[g] for g in glyphOrder]
while mapping and mapping[-2] == mapping[-1]:
while len(mapping) > 1 and mapping[-2] == mapping[-1]:
del mapping[-1]
rawTable = { 'mapping': mapping }