Merge pull request #14270 from Snuffleupagus/issue-14269
When parsing corrupt documents without any trailer-dictionary, fallback to the "top"-dictionary (issue 14269)
This commit is contained in:
commit
db41c49321
@ -590,6 +590,10 @@ class XRef {
|
|||||||
if (trailerDict) {
|
if (trailerDict) {
|
||||||
return trailerDict;
|
return trailerDict;
|
||||||
}
|
}
|
||||||
|
// No trailer dictionary found, taking the "top"-dictionary (if exists).
|
||||||
|
if (this.topDict) {
|
||||||
|
return this.topDict;
|
||||||
|
}
|
||||||
// nothing helps
|
// nothing helps
|
||||||
throw new InvalidPDFException("Invalid PDF structure.");
|
throw new InvalidPDFException("Invalid PDF structure.");
|
||||||
}
|
}
|
||||||
@ -680,6 +684,8 @@ class XRef {
|
|||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
info("(while reading XRef): " + e);
|
info("(while reading XRef): " + e);
|
||||||
|
|
||||||
|
this.startXRefQueue.shift();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recoveryMode) {
|
if (recoveryMode) {
|
||||||
|
1
test/pdfs/issue14269.pdf.link
Normal file
1
test/pdfs/issue14269.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://github.com/mozilla/pdf.js/files/7529789/test.pdf
|
@ -91,6 +91,14 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue14269",
|
||||||
|
"file": "pdfs/issue14269.pdf",
|
||||||
|
"md5": "f34abf77a418f54e13fbcd03b063432e",
|
||||||
|
"rounds": 1,
|
||||||
|
"link": true,
|
||||||
|
"lastPage": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{ "id": "issue11549",
|
{ "id": "issue11549",
|
||||||
"file": "pdfs/issue11549_reduced.pdf",
|
"file": "pdfs/issue11549_reduced.pdf",
|
||||||
"md5": "a1ea636f413e02e10dbdf379ab4a99ae",
|
"md5": "a1ea636f413e02e10dbdf379ab4a99ae",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user