Merge pull request #883 from anthrotype/fix-empty-cff-delta
[cffLib/psCharStrings] fix IndexError with empty deltas
This commit is contained in:
commit
f662391091
@ -1086,7 +1086,7 @@ class NumberConverter(SimpleConverter):
|
||||
|
||||
class ArrayConverter(SimpleConverter):
|
||||
def xmlWrite(self, xmlWriter, name, value, progress):
|
||||
if isinstance(value[0], list):
|
||||
if value and isinstance(value[0], list):
|
||||
xmlWriter.begintag(name)
|
||||
xmlWriter.newline()
|
||||
xmlWriter.indent()
|
||||
@ -1907,6 +1907,8 @@ class DictCompiler(object):
|
||||
data.append(self.arg_number(num))
|
||||
return bytesjoin(data)
|
||||
def arg_delta(self, value):
|
||||
if not value:
|
||||
return b""
|
||||
val0 = value[0]
|
||||
if isinstance(val0, list):
|
||||
data = self.arg_delta_blend(value)
|
||||
|
@ -1319,7 +1319,8 @@ class DictDecompiler(ByteCodeBase):
|
||||
def arg_delta(self, name):
|
||||
valueList = self.popall()
|
||||
out = []
|
||||
if isinstance(valueList[0], list): # arg_blendList() has already converted these to absolute values.
|
||||
if valueList and isinstance(valueList[0], list):
|
||||
# arg_blendList() has already converted these to absolute values.
|
||||
out = valueList
|
||||
else:
|
||||
current = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user