]> git.ipfire.org Git - thirdparty/zstd.git/commit
[libzstd] Fix parameter selection for empty input 903/head
authorNick Terrell <terrelln@fb.com>
Thu, 26 Oct 2017 00:10:57 +0000 (17:10 -0700)
committerNick Terrell <terrelln@fb.com>
Thu, 26 Oct 2017 00:24:15 +0000 (17:24 -0700)
commit86b8134cadadc7dcfb7f9e43baa54212ea7c58c3
tree9fe46277fdec6574796ccebe8c02bacc6a4837be
parent97dccbbb2b9905d491c65ccab79d53e3b0a05187
[libzstd] Fix parameter selection for empty input

ZSTD_compress() and friends would treat an empty input as an unknown size
when selecting parameters. Thus, they would drastically overallocate the
context. Tell ZSTD_getParams() that the source size is 1 when it is empty.
lib/compress/zstd_compress.c
tests/fuzzer.c