spa: limit the number of buffer blocks

Unbounded values might overflow the stack.
This commit is contained in:
Wim Taymans 2026-05-08 12:17:50 +02:00
parent 3a503ea4b6
commit 4a303edb9e
2 changed files with 2 additions and 0 deletions

View file

@ -507,6 +507,7 @@ static int negotiate_buffers(struct impl *this)
if (this->async)
buffers = SPA_MAX(2u, buffers);
blocks = SPA_MIN(blocks, 256u);
spa_log_info(this->log, "%p: buffers:%d, blocks:%d, size:%d, stride:%d align:%d %d:%d",
this, buffers, blocks, size, stride, align, follower_alloc, conv_alloc);

View file

@ -512,6 +512,7 @@ static int negotiate_buffers(struct impl *this)
if (this->async)
buffers = SPA_MAX(2u, buffers);
blocks = SPA_MIN(blocks, 256u);
spa_log_info(this->log, "%p: buffers:%d, blocks:%d, size:%d, stride:%d align:%d %d:%d",
this, buffers, blocks, size, stride, align, follower_alloc, conv_alloc);