From e423844f9bea9e77c51b2fecca57a7c26c7978c0 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 4 May 2026 12:12:01 +0200 Subject: [PATCH] filter-graph: reject too many impulse response files --- spa/plugins/filter-graph/plugin_builtin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spa/plugins/filter-graph/plugin_builtin.c b/spa/plugins/filter-graph/plugin_builtin.c index e002eb888..09dc29179 100644 --- a/spa/plugins/filter-graph/plugin_builtin.c +++ b/spa/plugins/filter-graph/plugin_builtin.c @@ -1339,6 +1339,10 @@ static void * convolver2_instantiate(const struct spa_fga_plugin *plugin, const } spa_json_enter(&it[0], &it[1]); while (spa_json_enter_object(&it[1], &it[2]) > 0) { + if (n_ir >= (int)SPA_N_ELEMENTS(ir)) { + spa_log_error(pl->log, "convolver2:too many impulses (%d)", n_ir); + goto error; + } ir[n_ir] = IMPULSE_INIT(n_ir); if ((res = convolver_read_impulse(pl, &it[2], SampleRate, &ir[n_ir])) < 0) return NULL;