Skip to content

Commit 07d3c9f

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 d27c8f2 commit 07d3c9f

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
@@ -269,6 +269,9 @@ func (p *playerImpl) getTmpBuf() ([]byte, func()) {
269269
if p.bufPool == nil {
270270
return
271271
}
272+
if len(*buf) != p.bufferSize {
273+
return
274+
}
272275
p.bufPool.Put(buf)
273276
}
274277
}

0 commit comments

Comments
 (0)