diff --git a/src/core/xref.js b/src/core/xref.js index 401fb0024..35ea6e7d9 100644 --- a/src/core/xref.js +++ b/src/core/xref.js @@ -590,6 +590,10 @@ class XRef { if (trailerDict) { return trailerDict; } + // No trailer dictionary found, taking the "top"-dictionary (if exists). + if (this.topDict) { + return this.topDict; + } // nothing helps throw new InvalidPDFException("Invalid PDF structure."); } @@ -680,6 +684,8 @@ class XRef { throw e; } info("(while reading XRef): " + e); + + this.startXRefQueue.shift(); } if (recoveryMode) { diff --git a/test/pdfs/issue14269.pdf.link b/test/pdfs/issue14269.pdf.link new file mode 100644 index 000000000..02d7011a1 --- /dev/null +++ b/test/pdfs/issue14269.pdf.link @@ -0,0 +1 @@ +https://github.com/mozilla/pdf.js/files/7529789/test.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index d06be788a..1bd10bd55 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -91,6 +91,14 @@ "rounds": 1, "type": "eq" }, + { "id": "issue14269", + "file": "pdfs/issue14269.pdf", + "md5": "f34abf77a418f54e13fbcd03b063432e", + "rounds": 1, + "link": true, + "lastPage": 1, + "type": "eq" + }, { "id": "issue11549", "file": "pdfs/issue11549_reduced.pdf", "md5": "a1ea636f413e02e10dbdf379ab4a99ae",