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:
commit
c419c8333b
1 changed files with 7 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue