Concat data when push fails in the CFF compiler
This commit is contained in:
parent
f2a29e858f
commit
3d0ce1cff2
@ -1390,11 +1390,12 @@ class CFFCompiler {
|
|||||||
data: [],
|
data: [],
|
||||||
length: 0,
|
length: 0,
|
||||||
add(data) {
|
add(data) {
|
||||||
if (data.length <= 65536) {
|
try {
|
||||||
// The number of arguments is limited, hence we just take 65536 as
|
// It's possible to exceed the call stack maximum size when trying
|
||||||
// limit because it isn't too high or too low.
|
// to push too much elements.
|
||||||
|
// In case of failure, we fallback to the `concat` method.
|
||||||
this.data.push(...data);
|
this.data.push(...data);
|
||||||
} else {
|
} catch {
|
||||||
this.data = this.data.concat(data);
|
this.data = this.data.concat(data);
|
||||||
}
|
}
|
||||||
this.length = this.data.length;
|
this.length = this.data.length;
|
||||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -598,3 +598,4 @@
|
|||||||
!issue16473.pdf
|
!issue16473.pdf
|
||||||
!bug1529502.pdf
|
!bug1529502.pdf
|
||||||
!issue16500.pdf
|
!issue16500.pdf
|
||||||
|
!issue16538.pdf
|
||||||
|
BIN
test/pdfs/issue16538.pdf
Normal file
BIN
test/pdfs/issue16538.pdf
Normal file
Binary file not shown.
@ -7713,5 +7713,12 @@
|
|||||||
"value": ["Three", "Five"]
|
"value": ["Three", "Five"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"id": "issue16538",
|
||||||
|
"file": "pdfs/issue16538.pdf",
|
||||||
|
"md5": "35b691c3a343f4531bd287b001b67a77",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user