[morx] Make sure that morx subtables have the expected length

This commit is contained in:
Sascha Brawer 2017-10-25 06:49:23 +02:00
parent 5316bb83b6
commit 18fae34cad

View File

@ -902,9 +902,11 @@ class MorxSubtableConverter(BaseConverter):
# The easiest way to pass this along is to create a new reader # The easiest way to pass this along is to create a new reader
# that works on just the subtable as its data. # that works on just the subtable as its data.
headerLength = reader.pos - pos headerLength = reader.pos - pos
subReader = OTTableReader( data = reader.data[
data=reader.data[reader.pos : reader.pos + m.StructLength - headerLength], reader.pos
tableTag=reader.tableTag) : reader.pos + m.StructLength - headerLength]
assert len(data) == m.StructLength - headerLength
subReader = OTTableReader(data=data, tableTag=reader.tableTag)
m.SubStruct = tableClass() m.SubStruct = tableClass()
m.SubStruct.decompile(subReader, font) m.SubStruct.decompile(subReader, font)
reader.seek(pos + m.StructLength) reader.seek(pos + m.StructLength)