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 #15152 from Snuffleupagus/validate-Resources

Ensure that the /Resources-entry is actually a dictionary (issue 15150)
This commit is contained in:
Jonas Jenwald 2022-07-08 13:24:47 +02:00 committed by GitHub
commit 4b493c2c33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 1 deletions

View file

@ -132,10 +132,12 @@ class Page {
// For robustness: The spec states that a \Resources entry has to be
// present, but can be empty. Some documents still omit it; in this case
// we return an empty dictionary.
const resources = this._getInheritableProperty("Resources");
return shadow(
this,
"resources",
this._getInheritableProperty("Resources") || Dict.empty
resources instanceof Dict ? resources : Dict.empty
);
}