]> git.ipfire.org Git - thirdparty/zstd.git/commit
[zstdmt] Fix bug where extra empty blocks are emitted
authorNick Terrell <terrelln@fb.com>
Tue, 6 Oct 2020 00:37:19 +0000 (17:37 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 12 Oct 2020 19:55:17 +0000 (12:55 -0700)
commitede4f97153324bf640cdc9020eed1a85edd18ad4
treeea82b6c1350ab86e400e59879ed471c1c26f718f
parent9ab9229e1175c8f17de6505c43992b474ee1a924
[zstdmt] Fix bug where extra empty blocks are emitted

When zstdmt cannot get a buffer and `ZSTD_e_end` is passed an empty
compression job can be created. Additionally, `mtctx->frameEnded` can be
set to 1, which could potentially cause problems like unterminated blocks.

The fix is to adjust to `ZSTD_e_flush` even when we can't get a buffer.
lib/compress/zstdmt_compress.c
tests/zstreamtest.c