Skip to content

Commit

Permalink
Add even more validation of width-data (PR 18017 follow-up)
Browse files Browse the repository at this point in the history
I missed this case in PR 18017, sorry about that.
  • Loading branch information
Snuffleupagus committed May 2, 2024
1 parent 16dbf5d commit 6c05f8b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4315,11 +4315,15 @@ class PartialEvaluator {
dict,
properties
);
if (widths) {
if (Array.isArray(widths)) {
const glyphWidths = [];
let j = firstChar;
for (const width of widths) {
glyphWidths[j++] = this.xref.fetchIfRef(width);
for (const w of widths) {
const width = this.xref.fetchIfRef(w);
if (typeof width === "number") {
glyphWidths[j] = width;
}
j++;
}
newProperties.widths = glyphWidths;
} else {
Expand Down

0 comments on commit 6c05f8b

Please sign in to comment.