Skip to content

Commit e46791d

Browse files
authored
Merge pull request #107 from francoispqt/feature/improved-stream
Improve streaming
2 parents 6901b37 + e5b786c commit e46791d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

decode.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ func (dec *Decoder) read() bool {
344344
// if we reach the end, double the buffer to ensure there's always more space
345345
if len(dec.data) == dec.length {
346346
nLen := dec.length * 2
347+
if nLen == 0 {
348+
nLen = 512
349+
}
347350
Buf := make([]byte, nLen, nLen)
348351
copy(Buf, dec.data)
349352
dec.data = Buf

0 commit comments

Comments
 (0)