Skip to content

Commit 6ac58c9

Browse files
authored
s2: Fix incorrect length encoded by writer.AddSkippableBlock (#917)
1 parent 515f153 commit 6ac58c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

s2/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ func (w *Writer) AddSkippableBlock(id uint8, data []byte) (err error) {
273273
return fmt.Errorf("skippable block excessed maximum size")
274274
}
275275
var header [4]byte
276-
chunkLen := 4 + len(data)
276+
chunkLen := len(data)
277277
header[0] = id
278278
header[1] = uint8(chunkLen >> 0)
279279
header[2] = uint8(chunkLen >> 8)

0 commit comments

Comments
 (0)