From 93e9efc1e48e3842da0d20bf4407db96a9e899da Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 1 Sep 2021 13:09:35 +0200 Subject: [PATCH] audioconvert: handle NULL param --- spa/plugins/audioconvert/channelmix.c | 3 +++ spa/plugins/audioconvert/fmtconvert.c | 2 ++ spa/plugins/audioconvert/merger.c | 3 +++ spa/plugins/audioconvert/splitter.c | 3 +++ 4 files changed, 11 insertions(+) diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index e8adbff4f..5fbf15e08 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -516,6 +516,9 @@ static int apply_props(struct impl *this, const struct spa_pod *param) bool have_channel_volume = false; bool have_soft_volume = false; + if (param == NULL) + return 0; + SPA_POD_OBJECT_FOREACH(obj, prop) { switch (prop->key) { case SPA_PROP_volume: diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index 3ab852df2..aeeaf8525 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -723,6 +723,8 @@ impl_node_port_set_param(void *object, case SPA_PARAM_Latency: { struct spa_latency_info info; + if (param == NULL) + return 0; if ((res = spa_latency_parse(param, &info)) < 0) return res; if (direction == info.direction) diff --git a/spa/plugins/audioconvert/merger.c b/spa/plugins/audioconvert/merger.c index 348bb4c3e..015c0dcc1 100644 --- a/spa/plugins/audioconvert/merger.c +++ b/spa/plugins/audioconvert/merger.c @@ -499,6 +499,9 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags, spa_return_val_if_fail(this != NULL, -EINVAL); + if (param == NULL) + return 0; + switch (id) { case SPA_PARAM_PortConfig: { diff --git a/spa/plugins/audioconvert/splitter.c b/spa/plugins/audioconvert/splitter.c index 55b4d3452..982536e5c 100644 --- a/spa/plugins/audioconvert/splitter.c +++ b/spa/plugins/audioconvert/splitter.c @@ -284,6 +284,9 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags, spa_return_val_if_fail(this != NULL, -EINVAL); + if (param == NULL) + return 0; + switch (id) { case SPA_PARAM_PortConfig: {