Check size of split.lengths instead of a nil check

Fixes https://github.com/andybalholm/brotli/issues/14
This commit is contained in:
oguzyildiz1991 2020-07-16 22:21:39 -04:00 committed by Andy Balholm
parent c3da72aa01
commit 1b06c5640c
1 changed files with 1 additions and 1 deletions

View File

@ -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