diff --git a/spa/plugins/filter-graph/filter-graph.c b/spa/plugins/filter-graph/filter-graph.c index 246c1ae53..1b0936459 100644 --- a/spa/plugins/filter-graph/filter-graph.c +++ b/spa/plugins/filter-graph/filter-graph.c @@ -2204,6 +2204,10 @@ static int load_graph(struct graph *graph, const struct spa_dict *props) if ((res = load_node(graph, &it[1])) < 0) return res; } + if (spa_list_is_empty(&graph->node_list)) { + spa_log_error(impl->log, "filter.graph has no nodes"); + return -EINVAL; + } if (plinks != NULL) { while (spa_json_enter_object(plinks, &it[1]) > 0) { if ((res = parse_link(graph, &it[1])) < 0) @@ -2256,7 +2260,6 @@ static int load_graph(struct graph *graph, const struct spa_dict *props) else graph->default_outputs = last->desc->n_output; - return 0; } diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index acfc85ed0..1c803f4fd 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -1619,7 +1619,7 @@ static const struct pw_stream_events out_stream_events = { static int setup_streams(struct impl *impl) { - int res; + int res = 0; uint32_t i, n_params, *offs, flags; struct pw_array offsets; const struct spa_pod **params = NULL;