]> git.ipfire.org Git - thirdparty/zstd.git/commit
Bug fix & run overflow correction much more frequently in tests 2603/head
authorNick Terrell <terrelln@fb.com>
Mon, 3 May 2021 21:37:06 +0000 (14:37 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 3 May 2021 22:21:47 +0000 (15:21 -0700)
commit34aff7ea06b550d90f90c886b39c690b1865cd45
tree4e0e117e31b97e7e8946d9b38f41f8990cee4f3c
parentcc31bb8b660de790ec4b0e024143ab473b1ada48
Bug fix & run overflow correction much more frequently in tests

* Fix overflow correction when `windowLog < cycleLog`. Previously, we
  got the correction wrong in this case, and our chain tables and binary
  trees would be corrupted. Now, we work as long as `maxDist` is a power
  of two, by adding `MAX(maxDist, cycleSize)` to our indices.
* When `ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY` is defined to non-zero
  run overflow correction as frequently as allowed without impacting
  compression ratio.
* Enable `ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY` in `fuzzer` and
  `zstreamtest` as well as all the OSS-Fuzz fuzzers. This has a 5-10%
  speed penalty at most, which seems reasonable.
lib/compress/zstd_compress.c
lib/compress/zstd_compress_internal.h
lib/compress/zstd_ldm.c
tests/Makefile
tests/zstreamtest.c