mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-03 06:47:04 -04:00
security: add missing create_tag check in update_stream_sample_rate
If a client sends UPDATE_PLAYBACK_STREAM_SAMPLE_RATE before format negotiation completes, stream->ss.rate could be 0, causing a floating-point division by zero. Add the same create_tag guard used in do_set_stream_buffer_attr. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
890c06117a
commit
8e7ca70352
1 changed files with 2 additions and 0 deletions
|
|
@ -4685,6 +4685,8 @@ static int do_update_stream_sample_rate(struct client *client, uint32_t command,
|
|||
stream = pw_map_lookup(&client->streams, channel);
|
||||
if (stream == NULL || stream->type == STREAM_TYPE_UPLOAD)
|
||||
return -ENOENT;
|
||||
if (stream->create_tag != SPA_ID_INVALID)
|
||||
return -ENOENT;
|
||||
|
||||
if (rate == 0 || rate > RATE_MAX)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue