Skip to content

Commit

Permalink
Fix error reading concatenated pdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-thoms committed Apr 4, 2015
1 parent 32cc021 commit 1b153ad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/core/obj.js
Original file line number Diff line number Diff line change
Expand Up @@ -1051,12 +1051,13 @@ var XRef = (function XRefClosure() {
trailers.push(position);
position += skipUntil(buffer, position, startxrefBytes);
} else if ((m = /^(\d+)\s+(\d+)\s+obj\b/.exec(token))) {
this.entries[m[1]] = {
offset: position,
gen: m[2] | 0,
uncompressed: true
};

if (typeof this.entries[m[1]] === 'undefined') {
this.entries[m[1]] = {
offset: position,
gen: m[2] | 0,
uncompressed: true
};
}
var contentLength = skipUntil(buffer, position, endobjBytes) + 7;
var content = buffer.subarray(position, position + contentLength);

Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,4 @@
!issue5481.pdf
!issue5567.pdf
!issue5701.pdf
!issue5909.pdf
Binary file added test/pdfs/issue5909.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2080,5 +2080,11 @@
"md5": "d5b37f8bf1b3aafa1b4fcf19ebdc7c74",
"rounds": 1,
"type": "eq"
},
{ "id": "issue5909",
"file": "pdfs/issue5909.pdf",
"md5": "65c169b6f540b27ac0ff2738a80d1e14",
"rounds": 1,
"type": "eq"
}
]

0 comments on commit 1b153ad

Please sign in to comment.