Skip to content

Commit

Permalink
Merge pull request #18037 from Snuffleupagus/validate-more-widths
Browse files Browse the repository at this point in the history
Add even more validation of width-data (PR 18017 follow-up)
  • Loading branch information
Snuffleupagus authored May 2, 2024
2 parents 2f7a4d5 + 6c05f8b commit c419c83
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 c419c83

Please sign in to comment.