mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05: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)
|
if (spa_format_audio_raw_parse(format, &info.info.raw) < 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (info.info.raw.channels > SPA_AUDIO_MAX_CHANNELS)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
infop = &info;
|
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));
|
spa_log_error(this->log, "can't parse format %s", spa_strerror(res));
|
||||||
return 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);
|
port->stride = calc_width(&info);
|
||||||
if (SPA_AUDIO_FORMAT_IS_PLANAR(info.info.raw.format)) {
|
if (SPA_AUDIO_FORMAT_IS_PLANAR(info.info.raw.format)) {
|
||||||
port->blocks = info.info.raw.channels;
|
port->blocks = info.info.raw.channels;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue