Add even more validation of width-data (PR 18017 follow-up)
I missed this case in PR 18017, sorry about that.
This commit is contained in:
parent
16dbf5dcfd
commit
6c05f8b381
@ -4315,11 +4315,15 @@ class PartialEvaluator {
|
|||||||
dict,
|
dict,
|
||||||
properties
|
properties
|
||||||
);
|
);
|
||||||
if (widths) {
|
if (Array.isArray(widths)) {
|
||||||
const glyphWidths = [];
|
const glyphWidths = [];
|
||||||
let j = firstChar;
|
let j = firstChar;
|
||||||
for (const width of widths) {
|
for (const w of widths) {
|
||||||
glyphWidths[j++] = this.xref.fetchIfRef(width);
|
const width = this.xref.fetchIfRef(w);
|
||||||
|
if (typeof width === "number") {
|
||||||
|
glyphWidths[j] = width;
|
||||||
|
}
|
||||||
|
j++;
|
||||||
}
|
}
|
||||||
newProperties.widths = glyphWidths;
|
newProperties.widths = glyphWidths;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user