image-rs / deflate-rs

An implementation of a DEFLATE encoder in rust
Apache License 2.0
53 stars 14 forks source link

Assertion error from fuzzing #17

Closed killercup closed 7 years ago

killercup commented 7 years ago

Fuzzing (fuzzer code here) triggers an assertion error in this line (looks like an overflow thing):

thread '<unnamed>' panicked at 'assertion failed: `(left == right)` (left: `32767`, right: `0`)', /home/pascal/.cargo/git/checkouts/deflate-rs-44887ade842f84eb/8e1ec1e/src/chained_hash_table.rs:126

You can find the whole log here: https://gist.github.com/killercup/f117fd4a55ba3855b74d04acdfaf46d5 (make sure to look at the crash file in raw mode; it's encoded as a raw Rust byte string).

oyvindln commented 7 years ago

Thanks! I will look into it. The assertion is meant to check that all the input data has been through the hash chains that are used to look for matches, so in the case assertions are disabled, this would at worst mean slightly worse compression ratio