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

Merge pull request #18037 from Snuffleupagus/validate-more-widths

Add even more validation of width-data (PR 18017 follow-up)
This commit is contained in:
Jonas Jenwald 2024-05-02 14:41:02 +02:00 committed by GitHub
commit c419c8333b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 {