1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

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:
Jonas Jenwald 2024-05-02 11:24:15 +02:00
parent 16dbf5dcfd
commit 6c05f8b381

View file

@ -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 {