Skip to content

Commit

Permalink
Merge pull request #18166 from Snuffleupagus/bug-1898802
Browse files Browse the repository at this point in the history
Prevent XRef errors from breaking font loading (bug 1898802)
  • Loading branch information
Snuffleupagus committed May 24, 2024
2 parents 18a7bd6 + cfcb700 commit b78480a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,11 @@ class PartialEvaluator {
return this.fontCache.get(fontRef);
}

font = this.xref.fetchIfRef(fontRef);
try {
font = this.xref.fetchIfRef(fontRef);
} catch (ex) {
warn(`loadFont - lookup failed: "${ex}".`);
}
}

if (!(font instanceof Dict)) {
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/bug1898802.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://bugzilla.mozilla.org/attachment.cgi?id=9403877
9 changes: 9 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5447,6 +5447,15 @@
"lastPage": 1,
"type": "eq"
},
{
"id": "bug1898802",
"file": "pdfs/bug1898802.pdf",
"md5": "65c3af306253faa8967982812aff523e",
"rounds": 1,
"link": true,
"lastPage": 1,
"type": "eq"
},
{
"id": "issue4890",
"file": "pdfs/issue4890.pdf",
Expand Down

0 comments on commit b78480a

Please sign in to comment.