Merge pull request #4011 from Rob--W/issue-3885

Set eof to true at the end of a FlateStream
This commit is contained in:
Brendan Dahl 2014-01-07 10:52:37 -08:00
commit 2e7c71c75e
4 changed files with 19 additions and 4 deletions

View File

@ -508,12 +508,18 @@ var FlateStream = (function FlateStreamClosure() {
var buffer = this.ensureBuffer(bufferLength + blockLen);
var end = bufferLength + blockLen;
this.bufferLength = end;
for (var n = bufferLength; n < end; ++n) {
if (typeof (b = bytes[bytesPos++]) == 'undefined') {
if (blockLen === 0) {
if (typeof bytes[bytesPos] == 'undefined') {
this.eof = true;
break;
}
buffer[n] = b;
} else {
for (var n = bufferLength; n < end; ++n) {
if (typeof (b = bytes[bytesPos++]) == 'undefined') {
this.eof = true;
break;
}
buffer[n] = b;
}
}
this.bytesPos = bytesPos;
return;

View File

@ -62,3 +62,4 @@
!issue3371.pdf
!issue2956.pdf
!bug946506.pdf
!issue3885.pdf

BIN
test/pdfs/issue3885.pdf Normal file

Binary file not shown.

View File

@ -61,6 +61,14 @@
"lastPage": 2,
"type": "eq"
},
{ "id": "issue3885",
"file": "pdfs/issue3885.pdf",
"md5": "319c998910453bc44d40c7748cd2cb79",
"rounds": 1,
"firstPage": 1,
"lastPage": 1,
"type": "eq"
},
{ "id": "issue2833",
"file": "pdfs/issue2833.pdf",
"md5": "7bc6e17c41586155c188d7408bcb9ab5",