]> git.ipfire.org Git - thirdparty/zstd.git/commit
[libzstd] Fix decompression dictionary bugs and clean up initialization
authorNick Terrell <terrelln@fb.com>
Wed, 10 Apr 2019 19:34:21 +0000 (12:34 -0700)
committerNick Terrell <terrelln@fb.com>
Wed, 10 Apr 2019 19:59:02 +0000 (12:59 -0700)
commit50b9c41196f77c3ff89cfd1d4cd4a81372b80c64
tree8a4593a88ed9fc643fe727073d6a6b41446c8c5b
parentf86d4bd1d53c46aaa83c7b5720f44b4f758e6d06
[libzstd] Fix decompression dictionary bugs and clean up initialization

Bugs:

* `ZSTD_DCtx_refPrefix()` didn't clear the dictionary after the first
  use. Fix and add a test case.
* `ZSTD_DCtx_reset()` always cleared the dictionary. Fix and add a test
  case.
* After calling `ZSTD_resetDStream()` you could no longer load a
  dictionary, since the stage was set to `zdss_loadHeader`. Fix and add
  a test case.

Cleanup:

* Make `ZSTD_initDStream*()` and `ZSTD_resetDStream()` wrap the new
 advanced API, and add test cases.
* Document the equivalent of these functions in the advanced API and
  document the unstable functions as deprecated.
lib/decompress/zstd_decompress.c
lib/decompress/zstd_decompress_internal.h
lib/zstd.h
tests/fuzzer.c
tests/zstreamtest.c