From 493f2b1abdcd2e76061f41228843b02431634380 Mon Sep 17 00:00:00 2001 From: naivewong <867245430@qq.com> Date: Fri, 11 Jan 2019 21:56:32 +0800 Subject: [PATCH] Missing the len of crc32 when calculating maxLen in WriteChunks Signed-off-by: naivewong <867245430@qq.com> --- chunks/chunks.go | 1 + 1 file changed, 1 insertion(+) diff --git a/chunks/chunks.go b/chunks/chunks.go index 5eab2398..569aeddc 100644 --- a/chunks/chunks.go +++ b/chunks/chunks.go @@ -205,6 +205,7 @@ func (w *Writer) WriteChunks(chks ...Meta) error { for _, c := range chks { maxLen += binary.MaxVarintLen32 + 1 // The number of bytes in the chunk and its encoding. maxLen += int64(len(c.Chunk.Bytes())) + maxLen += 4 // The 4 bytes of crc32 } newsz := w.n + maxLen