Extra protection
Fixes https://github.com/fonttools/fonttools/issues/797 Although for the XML->binary case, that bug was already fixed on master because of the XML populate-default changes. This adds extra protection!
This commit is contained in:
parent
80535c224e
commit
e4d88b5a38
@ -206,7 +206,7 @@ class VarData(BaseTable):
|
|||||||
|
|
||||||
numShorts = 0
|
numShorts = 0
|
||||||
count = len(self.VarRegionIndex)
|
count = len(self.VarRegionIndex)
|
||||||
for item in self.Item:
|
for item in getattr(self, Item, []):
|
||||||
assert len(item) == count, ("Item length mismatch", len(item), count)
|
assert len(item) == count, ("Item length mismatch", len(item), count)
|
||||||
for i in range(count - 1, numShorts - 1, -1):
|
for i in range(count - 1, numShorts - 1, -1):
|
||||||
if not (-128 <= item[i] <= 127):
|
if not (-128 <= item[i] <= 127):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user