client-node: refuse the wrong amount of client buffers

Make sure we get the same amount of buffers from the client as
we asked to allocate.
This commit is contained in:
Wim Taymans 2020-06-02 15:18:18 +02:00
parent bb1cb530fc
commit c04a9b546d

View file

@ -1028,6 +1028,9 @@ static int client_node_port_buffers(void *data,
if ((mix = find_mix(p, mix_id)) == NULL || !mix->valid) if ((mix = find_mix(p, mix_id)) == NULL || !mix->valid)
return -EINVAL; return -EINVAL;
if (mix->n_buffers != n_buffers)
return -EINVAL;
for (i = 0; i < n_buffers; i++) { for (i = 0; i < n_buffers; i++) {
struct spa_buffer *oldbuf, *newbuf; struct spa_buffer *oldbuf, *newbuf;