diff options
author | Lode Vandevenne <lode@google.com> | 2013-01-29 07:21:18 -0800 |
---|---|---|
committer | Lode Vandevenne <lode@google.com> | 2013-01-29 07:21:18 -0800 |
commit | 143f730cde02e78a0e8185d18b02ddb47ac2fed0 (patch) | |
tree | 88d3d9ca5f314bcf0463b5f56f9b314e13f535e9 | |
parent | 340a133d08c3c1ec9a0e03669ff692185c520e8c (diff) | |
download | zopfli-143f730cde02e78a0e8185d18b02ddb47ac2fed0.tar.gz |
Fix bug with large blocks
-rw-r--r-- | deflate.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -665,8 +665,9 @@ void Deflate(const Options* options, int btype, int final, #else size_t i = 0; while (i < insize) { - int final2 = final && (i + MASTER_BLOCK_SIZE >= insize); - size_t size = final ? insize - i : MASTER_BLOCK_SIZE; + int masterfinal = (i + MASTER_BLOCK_SIZE >= insize); + int final2 = final && masterfinal; + size_t size = masterfinal ? insize - i : MASTER_BLOCK_SIZE; DeflatePart(options, btype, final2, in, i, i + size, bp, out, outsize); i += size; } |