]> git.ipfire.org Git - thirdparty/zstd.git/commit
fix #942 : streaming interface does not compress after ZSTD_initCStream()
authorYann Collet <cyan@fb.com>
Thu, 7 Dec 2017 07:52:50 +0000 (02:52 -0500)
committerYann Collet <cyan@fb.com>
Thu, 7 Dec 2017 07:52:50 +0000 (02:52 -0500)
commit3aa2b27a890e9aa4c64b9e52632a6ef4c1418041
tree83cb2f0137d85ca172d6fda780cbf11928480874
parent896980ec15ea7e2a701155cbfb060de915f1e77f
fix #942 : streaming interface does not compress after ZSTD_initCStream()

While the final result is still, technically, a frame,
the resulting frame expands initial data instead of compressing it.
This is because the streaming API creates a tiny 1-byte buffer for input,
because it believes input is empty (0-bytes),
because in the past, 0 used to mean "unknown" instead.

This patch fixes the issue.
Todo : add a test which traps the issue.
lib/compress/zstd_compress.c