client-node: don't overwrite the chunk memory pointer

When the client uploads a buffer, copy all data fields except for
the chunk memory that we configured before.
If we overwrite the chunk memory, the users of the buffer would not
be able to find the chunk memory anymore and crash or fail.
This commit is contained in:
Wim Taymans 2020-02-24 15:08:27 +01:00
parent 9e44b957f0
commit 41989f4889
2 changed files with 12 additions and 6 deletions

View file

@ -1062,9 +1062,7 @@ static int client_node_demarshal_port_buffers(void *object, const struct pw_prot
for (i = 0; i < n_buffers; i++) {
struct spa_buffer *buf = buffers[i] = alloca(sizeof(struct spa_buffer));
buf->n_metas = 0;
buf->metas = NULL;
spa_zero(*buf);
if (spa_pod_parser_get(&prs,
SPA_POD_Int(&buf->n_datas), NULL) < 0)
return -EINVAL;