Check size of split.lengths instead of a nil check
Fixes https://github.com/andybalholm/brotli/issues/14
This commit is contained in:
parent
c3da72aa01
commit
1b06c5640c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue