Ensure that the /Annots-entry, on /Page-instances, is actually an Array (issue 12714)

In the referenced PDF document, the second and third page has *corrupt* /Annots-entries which contain /Dict-data rather than the intended Arrays.
This commit is contained in:
Jonas Jenwald 2020-12-10 11:31:46 +01:00
parent 93b3ba2abb
commit 796a0d3155
3 changed files with 12 additions and 5 deletions

View File

@ -437,11 +437,8 @@ class Page {
}
get annotations() {
return shadow(
this,
"annotations",
this._getInheritableProperty("Annots") || []
);
const annots = this._getInheritableProperty("Annots");
return shadow(this, "annotations", Array.isArray(annots) ? annots : []);
}
get _parsedAnnotations() {

View File

@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/5669997/b49fe733-63e0-4972-8b47-3a05c2c8e881.pdf

View File

@ -2028,6 +2028,15 @@
"link": true,
"type": "eq"
},
{ "id": "issue12714",
"file": "pdfs/issue12714.pdf",
"md5": "f9ee31c74f9e342e95122b0b3bc84fa0",
"rounds": 1,
"firstPage": 2,
"lastPage": 2,
"link": true,
"type": "eq"
},
{ "id": "issue7872",
"file": "pdfs/issue7872.pdf",
"md5": "81781dfecfcb7e9cd9cc7e60f8b747b7",