Skip to content

Commit 6fb059b

Browse files
authored
Revert "fix: consider RLE blocks in zstd compatibility check (#64)"
This reverts commit ef47e96.
1 parent ef47e96 commit 6fb059b

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

encoding/da.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -495,16 +495,7 @@ func checkCompressedDataCompatibilityV7(data []byte) error {
495495
// scan each block until done
496496
for len(data) > 3 && !isLast {
497497
isLast = (data[0] & 1) == 1
498-
blkType := (data[0] >> 1) & 3
499-
var blkSize uint
500-
if blkType == 1 { // RLE Block
501-
blkSize = 1
502-
} else {
503-
if blkType == 3 {
504-
return fmt.Errorf("encounter reserved block type at %v", data)
505-
}
506-
blkSize = (uint(data[2])*65536 + uint(data[1])*256 + uint(data[0])) >> 3
507-
}
498+
blkSize := (uint(data[2])*65536 + uint(data[1])*256 + uint(data[0])) >> 3
508499
if len(data) < 3+int(blkSize) {
509500
return fmt.Errorf("wrong data len {%d}, expect min {%d}", len(data), 3+blkSize)
510501
}

0 commit comments

Comments
 (0)