]> Cypherpunks repositories - gostls13.git/commit
compress/flate: fix another deflate Reset inconsistency
authorRuss Cox <rsc@golang.org>
Thu, 16 Jul 2020 20:56:53 +0000 (16:56 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 16 Jul 2020 23:38:32 +0000 (23:38 +0000)
commit4469f5446ad754d87afb340f59c213aec2dc4fb8
treecf93d76caacc91b604fc9b3fcdc8a0a65ea7b3ed
parent8d4330742c1866faa8b1ef575877e5afb8a4355c
compress/flate: fix another deflate Reset inconsistency

While investigating #34121, fixed by CL 193605,
I discovered another case where Reset was not quite
resetting enough.

This specific case is not a problem in Reset itself but
rather that the Huffman bit writer in one code path
is using uninitialized memory left over from a previous
block, making the compression not choose the optimal
compression method.

Fixes #34121.

Change-Id: I29245b28214d924e382f91e2c56b4b8a9b7da13d
Reviewed-on: https://go-review.googlesource.com/c/go/+/243140
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
src/compress/flate/deflate_test.go
src/compress/flate/huffman_bit_writer.go