audioconvert: refuse invalid channels and rate

This commit is contained in:
Wim Taymans 2019-09-03 13:49:38 +02:00
parent 6341469456
commit 73628c91de
4 changed files with 7 additions and 1 deletions

@ -1 +1 @@
Subproject commit b1d2b9fb39d4b69075606a3d8c32d2d91a0053b1
Subproject commit dde5a0dee8c4806d4660e4b73be84e4aef55c824

View file

@ -914,6 +914,8 @@ static int configure_adapt(struct impl *this)
spa_pod_builder_init(&b, buffer, sizeof(buffer));
spa_log_debug(this->log, "%p: configure convert %p", this, this->target);
param = spa_pod_builder_add_object(&b,
SPA_TYPE_OBJECT_ParamPortConfig, SPA_PARAM_PortConfig,
SPA_PARAM_PORT_CONFIG_direction, SPA_POD_Id(this->direction),

View file

@ -727,6 +727,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 == 0 || info.info.raw.rate == 0)
return -EINVAL;
infop = &info;
}

View file

@ -187,6 +187,7 @@ static int test_split_setup(struct context *ctx)
spa_zero(info);
info.format = SPA_AUDIO_FORMAT_F32P;
info.channels = 6;
info.rate = 48000;
info.position[0] = SPA_AUDIO_CHANNEL_FL;
info.position[1] = SPA_AUDIO_CHANNEL_FR;
info.position[2] = SPA_AUDIO_CHANNEL_FC;