]> git.parisson.com Git - pdf.js.git/commitdiff
Copied entire buffer for flate stream's snarf function (since decoding looks back)
authorsbarman <sbarman@L3CWZ5T.(none)>
Wed, 8 Jun 2011 18:49:37 +0000 (11:49 -0700)
committersbarman <sbarman@L3CWZ5T.(none)>
Wed, 8 Jun 2011 18:49:37 +0000 (11:49 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index c771999d278e576254adb86368d86e5857fb3904..8e1cf904a1975b673c7ed6b3abf038e2256c1fed 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -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;