From 05064bd55850b0ee1b62162cb3e3a0fc1ad09375 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 20 Jun 2022 19:31:34 +0200 Subject: [PATCH] filter-chain: error out on 0 handles When we end up in a case where we are running 0 handles, such as when we have a stereo filter but we want mono output, emit an error until we can reasonably handle this case. --- src/modules/module-filter-chain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index 9e8b475b9..64371dec1 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -1699,6 +1699,11 @@ static int setup_graph(struct graph *graph, struct spa_json *inputs, struct spa_ res = -EINVAL; goto error; } + if (n_hndl == 0) { + pw_log_error("not enough channels"); + res = -EINVAL; + goto error; + } pw_log_info("using %d instances %d %d", n_hndl, n_input, n_output); /* now go over all nodes and create instances. */