mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-07 04:58:15 +02:00
stream: check buffer_id in reuse_buffer
This commit is contained in:
parent
49ce385c44
commit
f91b98a812
2 changed files with 4 additions and 0 deletions
|
|
@ -969,6 +969,8 @@ static int impl_port_reuse_buffer(void *object, uint32_t port_id, uint32_t buffe
|
|||
|
||||
if ((port = get_port(impl, SPA_DIRECTION_OUTPUT, port_id)) == NULL)
|
||||
return -EINVAL;
|
||||
if (buffer_id >= port->n_buffers)
|
||||
return -EINVAL;
|
||||
|
||||
pw_log_trace("%p: recycle buffer %d", impl, buffer_id);
|
||||
push_queue(port, &port->queued, &port->buffers[buffer_id]);
|
||||
|
|
|
|||
|
|
@ -1082,6 +1082,8 @@ static int impl_port_use_buffers(void *object,
|
|||
static int impl_port_reuse_buffer(void *object, uint32_t port_id, uint32_t buffer_id)
|
||||
{
|
||||
struct stream *d = object;
|
||||
if (buffer_id >= d->n_buffers)
|
||||
return -EINVAL;
|
||||
pw_log_trace("%p: recycle buffer %d", d, buffer_id);
|
||||
queue_push(d, &d->queued, &d->buffers[buffer_id]);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue