1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Make XRef_indexObjects more robust against bad PDF files (issue 5752)

This patch improves the detection of `xref` in files where it is followed by an arbitrary whitespace character (not just a line-breaking char).
It also adds a check for missing whitespace, e.g. `1 0 obj<<`, to speed up `readToken` for the PDF file in the referenced issue.
Finally, the patch also replaces a bunch of magic numbers with suitably named constants.

Fixes 5752.

Also improves 6243, but there are still issues.
This commit is contained in:
Jonas Jenwald 2015-08-21 16:57:08 +02:00
parent 23cb01c8af
commit 56a43a3181
3 changed files with 22 additions and 5 deletions

View file

@ -0,0 +1 @@
http://web.archive.org/web/20150821144004/http://222.247.54.152/Fulltext/qkyxlcyjy200504007.pdf

View file

@ -1071,6 +1071,15 @@
"lastPage": 1,
"type": "eq"
},
{ "id": "issue5752",
"file": "pdfs/issue5752.pdf",
"md5": "aa20ad7cff71e9481c0cd623ddbff3b7",
"rounds": 1,
"link": true,
"firstPage": 1,
"lastPage": 1,
"type": "eq"
},
{ "id": "issue2931",
"file": "pdfs/issue2931.pdf",
"md5": "ea40940eaf3541b312bda9329167da11",