From 1b06c5640cf6015263eb21836780d98b38e27098 Mon Sep 17 00:00:00 2001 From: oguzyildiz1991 Date: Thu, 16 Jul 2020 22:21:39 -0400 Subject: [PATCH] Check size of split.lengths instead of a nil check Fixes https://github.com/andybalholm/brotli/issues/14 --- histogram.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/histogram.go b/histogram.go index 44db4f3..0346622 100644 --- a/histogram.go +++ b/histogram.go @@ -163,7 +163,7 @@ func initBlockSplitIterator(self *blockSplitIterator, split *blockSplit) { self.split_ = split self.idx_ = 0 self.type_ = 0 - if split.lengths != nil { + if len(split.lengths) > 0 { self.length_ = uint(split.lengths[0]) } else { self.length_ = 0