diff --git a/fse/compress.go b/fse/compress.go index 65d777357a..074018d8f9 100644 --- a/fse/compress.go +++ b/fse/compress.go @@ -212,7 +212,7 @@ func (s *Scratch) writeCount() error { previous0 bool charnum uint16 - maxHeaderSize = ((int(s.symbolLen) * int(tableLog)) >> 3) + 3 + maxHeaderSize = ((int(s.symbolLen)*int(tableLog) + 4 + 2) >> 3) + 3 // Write Table Size bitStream = uint32(tableLog - minTablelog) diff --git a/fse/fuzz_test.go b/fse/fuzz_test.go index 6221d7e55b..563de714a1 100644 --- a/fse/fuzz_test.go +++ b/fse/fuzz_test.go @@ -9,7 +9,7 @@ import ( ) func FuzzCompress(f *testing.F) { - fuzz.AddFromZip(f, "testdata/fse_compress.zip", fuzz.TypeRaw, false) + fuzz.AddFromZip(f, "testdata/fse_compress.zip", fuzz.TypeGoFuzz, false) f.Fuzz(func(t *testing.T, buf0 []byte) { var s, s2 Scratch b, err := Compress(buf0, &s) diff --git a/fse/testdata/fse_compress.zip b/fse/testdata/fse_compress.zip index 9250408c9a..6a9d40968c 100644 Binary files a/fse/testdata/fse_compress.zip and b/fse/testdata/fse_compress.zip differ