]> Cypherpunks repositories - gostls13.git/commit
compress/bzip2: support superfluous Huffman levels.
authorAdam Langley <agl@golang.org>
Fri, 14 Feb 2014 22:17:19 +0000 (17:17 -0500)
committerAdam Langley <agl@golang.org>
Fri, 14 Feb 2014 22:17:19 +0000 (17:17 -0500)
commit9f0008bb93694410ccde7f44a86648ef1117e069
tree22aee209a8cf64ac7d859aed8426c84785e9c805
parent56872f02f0f69f32d4d919e4cacee9672e7a5a97
compress/bzip2: support superfluous Huffman levels.

These should never be found in a bzip2 file but it does appear that
there's a buggy encoder that is producing them. Since the official
bzip2 handles this case, this change makes the Go code do likewise.

With this change, the code produces the same output as the official
bzip2 code on the invalid example given in the bug.

Fixes #7279.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/64010043
src/pkg/compress/bzip2/huffman.go