fix creating broken files if they end with a match

This commit is contained in:
2021-12-27 22:34:14 +01:00
parent 08c86af06f
commit f7f891e154

View File

@@ -40,7 +40,9 @@ impl Op {
pub fn encode_eof(coder: &mut dyn EntropyCoder, state: &mut CoderState) {
encode_bit(coder, state, 0, true);
encode_bit(coder, state, 256, true);
if !state.prev_was_match {
encode_bit(coder, state, 256, true);
}
encode_length(coder, state, 257, 1);
}