Commit 2a8b7594 authored by Wim Taymans's avatar Wim Taymans
Browse files

pulse-server: avoid overflow

Make sure the requested bytes never go below 0.

See #1258
parent e65afe8f
Pipeline #332224 passed with stages
in 5 minutes and 1 second
......@@ -5518,7 +5518,7 @@ static int handle_memblock(struct client *client, struct message *msg)
SPA_MIN(msg->length, stream->attr.maxlength));
stream->write_index = index + msg->length;
spa_ringbuffer_write_update(&stream->ring, stream->write_index);
stream->requested -= msg->length;
stream->requested -= SPA_MIN(msg->length, stream->requested);
message_free(impl, msg, false, false);
return res;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment