mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
audioconvert: handle too many channels earlier
This commit is contained in:
parent
6bfe9a362c
commit
a365b19110
1 changed files with 8 additions and 0 deletions
|
|
@ -1008,6 +1008,9 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
|||
if (spa_format_audio_raw_parse(format, &info.info.raw) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (info.info.raw.channels > SPA_AUDIO_MAX_CHANNELS)
|
||||
return -EINVAL;
|
||||
|
||||
infop = &info;
|
||||
}
|
||||
|
||||
|
|
@ -1816,6 +1819,11 @@ static int port_set_format(void *object,
|
|||
spa_log_error(this->log, "can't parse format %s", spa_strerror(res));
|
||||
return res;
|
||||
}
|
||||
if (info.info.raw.channels > SPA_AUDIO_MAX_CHANNELS) {
|
||||
spa_log_error(this->log, "too many channels %d > %d",
|
||||
info.info.raw.channels, SPA_AUDIO_MAX_CHANNELS);
|
||||
return -EINVAL;
|
||||
}
|
||||
port->stride = calc_width(&info);
|
||||
if (SPA_AUDIO_FORMAT_IS_PLANAR(info.info.raw.format)) {
|
||||
port->blocks = info.info.raw.channels;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue