Skip to content

Commit

Permalink
Merge pull request #10441 from Snuffleupagus/indexObjects-more-nested…
Browse files Browse the repository at this point in the history
…-obj

Handle more cases of corrupt PDF files with missing 'endobj' operators, where the "obj" string is immediately followed by the dictionary (PR 9288 follow-up)
  • Loading branch information
timvandermeij committed Jan 12, 2019
2 parents e4d2a16 + d4a3858 commit eb7cd88
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ var XRef = (function XRefClosure() {
}
var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/;
const endobjRegExp = /\bendobj[\b\s]$/;
const nestedObjRegExp = /\s+(\d+\s+\d+\s+obj[\b\s])$/;
const nestedObjRegExp = /\s+(\d+\s+\d+\s+obj[\b\s<])$/;
const CHECK_CONTENT_LENGTH = 25;

var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]);
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
!issue9458.pdf
!issue9915_reduced.pdf
!issue9940.pdf
!issue10438_reduced.pdf
!bad-PageLabels.pdf
!decodeACSuccessive.pdf
!filled-background.pdf
Expand Down
Binary file added test/pdfs/issue10438_reduced.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,13 @@
"link": false,
"type": "eq"
},
{ "id": "issue10438",
"file": "pdfs/issue10438_reduced.pdf",
"md5": "bb26f68493e33af17b256a6ffe777a24",
"rounds": 1,
"link": false,
"type": "eq"
},
{ "id": "issue6289",
"file": "pdfs/issue6289.pdf",
"md5": "0869f3d147c734ec484ffd492104095d",
Expand Down

0 comments on commit eb7cd88

Please sign in to comment.