mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: avoid overflow
Make sure the requested bytes never go below 0. See #1258
This commit is contained in:
parent
e65afe8fa2
commit
2a8b7594bc
1 changed files with 1 additions and 1 deletions
|
|
@ -5518,7 +5518,7 @@ static int handle_memblock(struct client *client, struct message *msg)
|
||||||
SPA_MIN(msg->length, stream->attr.maxlength));
|
SPA_MIN(msg->length, stream->attr.maxlength));
|
||||||
stream->write_index = index + msg->length;
|
stream->write_index = index + msg->length;
|
||||||
spa_ringbuffer_write_update(&stream->ring, stream->write_index);
|
spa_ringbuffer_write_update(&stream->ring, stream->write_index);
|
||||||
stream->requested -= msg->length;
|
stream->requested -= SPA_MIN(msg->length, stream->requested);
|
||||||
finish:
|
finish:
|
||||||
message_free(impl, msg, false, false);
|
message_free(impl, msg, false, false);
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue