Skip to content

Commit 12990bb

Browse files
committed
internal/mux: do not put back an old buffer
Theoretically, it is possible to put an old-sized buffer to the pool. Closes #258
1 parent 6b9bbc1 commit 12990bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/mux/mux.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ func (p *playerImpl) getTmpBuf() ([]byte, func()) {
270270
if p.bufPool == nil {
271271
return
272272
}
273+
if len(*buf) != p.bufferSize {
274+
return
275+
}
273276
p.bufPool.Put(buf)
274277
}
275278
}

0 commit comments

Comments
 (0)