]> git.ipfire.org Git - thirdparty/zstd.git/commit
Avoid Reducing Indices to Reserved Values
authorW. Felix Handte <w@felixhandte.com>
Tue, 9 Nov 2021 01:03:52 +0000 (20:03 -0500)
committerW. Felix Handte <w@felixhandte.com>
Tue, 9 Nov 2021 01:03:52 +0000 (20:03 -0500)
commit61765cacd08103d47ce7c6709135f340d1074568
treecdb7ff457d8618bb9f05f0cbca7c4a51af5122d4
parent793b6cec730fbaa29bd3cd13986aa7cf6dffb7ec
Avoid Reducing Indices to Reserved Values

Previously, if an index was equal to `reducerValue + 1`, it would get remapped
during index reduction to 1 i.e. `ZSTD_DUBT_UNSORTED_MARK`. This can affect the
parsing of the input slightly, by causing tree nodes to be nullified when they
otherwise wouldn't be. This hardly matters from a correctness or efficiency
perspective, but it does impact determinism.

So this commit changes index reduction to avoid mapping indices to collide with
`ZSTD_DUBT_UNSORTED_MARK`.
lib/compress/zstd_compress.c