Merge pull request #12965 from Snuffleupagus/ObjectLoader-errors

Request all data, rather than throwing, when encountering general errors in `ObjectLoader._walk` (issue 9462, PR 3289 follow-up)
This commit is contained in:
Tim van der Meij 2021-02-06 19:38:04 +01:00 committed by GitHub
commit 8ccd9eac3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -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 });

View File

@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/1706865/cb7e7bd2362328f37fe97dc8dff151a3.pdf

View File

@ -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",