Skip to content

Commit 47eb6d4

Browse files
authored
zstd: Fix fallback on incompressible block (#798)
Regresssion from #792 (unreleased)
1 parent 5753c12 commit 47eb6d4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

zstd/blockenc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,8 @@ func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error {
782782
// Maybe even add a bigger margin.
783783
if len(b.output)-3-bhOffset >= b.size {
784784
// Discard and encode as raw block.
785-
b.encodeRaw(org)
785+
b.output = b.encodeRawTo(b.output[:bhOffset], org)
786+
b.popOffsets()
786787
b.litEnc.Reuse = huff0.ReusePolicyNone
787788
return nil
788789
}
683 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)