]> git.ipfire.org Git - thirdparty/zstd.git/commit
[fuzz] Add Huffman round trip fuzzer 2733/head
authorNick Terrell <terrelln@fb.com>
Tue, 3 Aug 2021 04:02:31 +0000 (21:02 -0700)
committerNick Terrell <terrelln@fb.com>
Tue, 3 Aug 2021 15:10:06 +0000 (08:10 -0700)
commitd8a07972687004a5446cd612404de8a1c5584188
tree961793c8bce37522f7600ef55e3c9bee7a2d8417
parent46f27105626e0e35a2f277d20469066ffe050c81
[fuzz] Add Huffman round trip fuzzer

* Add a Huffman round trip fuzzer
* Fix two minor bugs in Huffman that aren't exposed in zstd
  - Incorrect weight comparison (weights are allowed to be equal to
    table log).
  - HUF_compress1X_usingCTable_internal() can return compressed
    size >= source size, so the assert that `cSize <= 65535` isn't
    correct, and it needs to be checked instead.
lib/common/entropy_common.c
lib/common/huf.h
lib/compress/huf_compress.c
tests/fuzz/.gitignore
tests/fuzz/Makefile
tests/fuzz/fuzz.py
tests/fuzz/huf_round_trip.c [new file with mode: 0644]