Skip to content

Commit

Permalink
Merge pull request mozilla#12965 from Snuffleupagus/ObjectLoader-errors
Browse files Browse the repository at this point in the history
Request all data, rather than throwing, when encountering general errors in `ObjectLoader._walk` (issue 9462, PR 3289 follow-up)
  • Loading branch information
timvandermeij authored Feb 6, 2021
2 parents 6263a21 + d3e65f2 commit 8ccd9ea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -2556,7 +2556,11 @@ const ObjectLoader = (function () {
currentNode = this.xref.fetch(currentNode);
} catch (ex) {
if (!(ex instanceof MissingDataException)) {
throw ex;
warn(`ObjectLoader._walk - requesting all data: "${ex}".`);
this.refSet = null;

const { manager } = this.xref.stream;
return manager.requestAllChunks();
}
nodesToRevisit.push(currentNode);
pendingRequests.push({ begin: ex.begin, end: ex.end });
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/issue9462.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/1706865/cb7e7bd2362328f37fe97dc8dff151a3.pdf
9 changes: 9 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,15 @@
"rounds": 1,
"type": "load"
},
{ "id": "issue9462",
"file": "pdfs/issue9462.pdf",
"md5": "0a2895b0aa8a8ef730a20b4116cd996c",
"rounds": 1,
"link": true,
"firstPage": 3,
"lastPage": 3,
"type": "eq"
},
{ "id": "f1040",
"file": "pdfs/f1040.pdf",
"md5": "7323b50c6d28d959b8b4b92c469b2469",
Expand Down

0 comments on commit 8ccd9ea

Please sign in to comment.