Make sure Pako always has enough room

Previously, we used a fixed chunkSize of 100KiB for Pako's output
buffer.  Using a hardcoded size caused issues, since Pako would assume
we wanted to use multiple chunks, and we didn't deal with this.  Now,
`Inflator#inflate()` takes a new `expected` argument, which indicates
the expected output size.  If this is bigger than the current chunkSize,
Inflator allocates a new output buffer that's big enough to hold the
output.

Fixes #531
This commit is contained in:
Solly Ross
2015-09-22 16:19:52 -04:00
parent 40b35fa20d
commit c802d93189
4 changed files with 39 additions and 21 deletions

View File

@@ -2,4 +2,4 @@ Rebuilding inflator.js
- Download pako from npm
- Install browserify using npm
- browserify utils/inflator.partial.js -o include/inflator.js
- browserify utils/inflator.partial.js -o include/inflator.js -s inflator