diff --git a/zstd/blockdec.go b/zstd/blockdec.go index 9f17ce601f..c9a3697b75 100644 --- a/zstd/blockdec.go +++ b/zstd/blockdec.go @@ -489,6 +489,9 @@ func (b *blockDec) decodeCompressed(hist *history) error { return err } if hist.decoders.nSeqs == 0 { + if len(hist.decoders.literals) == 0 { + return errors.New("invalid block: no literals nor sequences found") + } b.dst = append(b.dst, hist.decoders.literals...) return nil } diff --git a/zstd/testdata/good.zip b/zstd/testdata/good.zip index e38a0f275c..4585a80c7a 100644 Binary files a/zstd/testdata/good.zip and b/zstd/testdata/good.zip differ