Copied entire buffer for flate stream's snarf function (since decoding looks back)

This commit is contained in:
sbarman 2011-06-08 11:49:37 -07:00
parent fe277b8d51
commit a89bd1d30e

4
pdf.js
View File

@ -322,7 +322,9 @@ var FlateStream = (function() {
var bufferLength = this.bufferLength;
var bufferPos = this.bufferPos;
var n = 0;
while (bufferPos < bufferLength)
// entire front of stream needs to be copied over since flate
// looksback when decoding
while (0 < bufferLength)
dest[n++] = this.buffer[bufferPos++];
// now use dest as our buffer and fill it
this.buffer = dest;