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

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;