filter-graph: reject too many impulse response files

This commit is contained in:
Wim Taymans 2026-05-04 12:12:01 +02:00
parent 62dbd49f5a
commit e423844f9b

View file

@ -1339,6 +1339,10 @@ static void * convolver2_instantiate(const struct spa_fga_plugin *plugin, const
} }
spa_json_enter(&it[0], &it[1]); spa_json_enter(&it[0], &it[1]);
while (spa_json_enter_object(&it[1], &it[2]) > 0) { 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); ir[n_ir] = IMPULSE_INIT(n_ir);
if ((res = convolver_read_impulse(pl, &it[2], SampleRate, &ir[n_ir])) < 0) if ((res = convolver_read_impulse(pl, &it[2], SampleRate, &ir[n_ir])) < 0)
return NULL; return NULL;