mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
modules: clamp input offset and size
So that we don't cause memory errors with invalid input.
This commit is contained in:
parent
24ba3f4d92
commit
0f839c7b61
10 changed files with 96 additions and 61 deletions
|
|
@ -310,11 +310,8 @@ static void capture_process(void *data)
|
|||
}
|
||||
d = &buf->buffer->datas[0];
|
||||
|
||||
size = d->chunk->size;
|
||||
offset = d->chunk->offset;
|
||||
|
||||
if (size + offset > d->maxsize)
|
||||
size = d->maxsize - SPA_MIN(offset, d->maxsize);
|
||||
offset = SPA_MIN(d->chunk->offset, d->maxsize);
|
||||
size = SPA_MIN(d->chunk->size, d->maxsize - offset);
|
||||
|
||||
while (size > 0) {
|
||||
res = send(client->source->fd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue