From 051a7ae1a7f1ad12fac71028af42ad81710ede4a Mon Sep 17 00:00:00 2001 From: Alec <867245430@qq.com> Date: Mon, 28 Jan 2019 18:33:44 +0800 Subject: [PATCH] Missing the length of the encoding byte when calling b.Range Signed-off-by: naivewong <867245430@qq.com> --- chunks/chunks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chunks/chunks.go b/chunks/chunks.go index 8fb288384..f35ad2cdd 100644 --- a/chunks/chunks.go +++ b/chunks/chunks.go @@ -373,7 +373,7 @@ func (s *Reader) Chunk(ref uint64) (chunkenc.Chunk, error) { if n <= 0 { return nil, errors.Errorf("reading chunk length failed with %d", n) } - r = b.Range(off+n, off+n+int(l)) + r = b.Range(off+n, off+n+1+int(l)) return s.pool.Get(chunkenc.Encoding(r[0]), r[1:1+l]) }