Fix error reading concatenated pdfs

This commit is contained in:
Jordan Thoms 2015-04-04 19:15:31 +13:00
parent 180a5a2746
commit d0ea772fc6
4 changed files with 14 additions and 6 deletions

View File

@ -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);

View File

@ -123,3 +123,4 @@
!issue5481.pdf
!issue5567.pdf
!issue5701.pdf
!issue5909.pdf

BIN
test/pdfs/issue5909.pdf Executable file

Binary file not shown.

View File

@ -2087,5 +2087,11 @@
"md5": "d5b37f8bf1b3aafa1b4fcf19ebdc7c74",
"rounds": 1,
"type": "eq"
},
{ "id": "issue5909",
"file": "pdfs/issue5909.pdf",
"md5": "51a724136c0c10008bd061a78ea4b8fc",
"rounds": 1,
"type": "load"
}
]