mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-12 04:27:45 -05:00
ucm: macro - add deep call protection (recursion)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
80ac6f9866
commit
55340cf96a
2 changed files with 7 additions and 0 deletions
|
|
@ -575,7 +575,13 @@ int uc_mgr_evaluate_inplace(snd_use_case_mgr_t *uc_mgr,
|
||||||
/* conditions may depend on them */
|
/* conditions may depend on them */
|
||||||
if (err2 == 0)
|
if (err2 == 0)
|
||||||
continue;
|
continue;
|
||||||
|
uc_mgr->macro_hops++;
|
||||||
|
if (uc_mgr->macro_hops > 100) {
|
||||||
|
uc_error("Maximal macro hops reached!");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
err3 = evaluate_macro(uc_mgr, cfg);
|
err3 = evaluate_macro(uc_mgr, cfg);
|
||||||
|
uc_mgr->macro_hops--;
|
||||||
if (err3 < 0)
|
if (err3 < 0)
|
||||||
return err3;
|
return err3;
|
||||||
if (err3 == 0)
|
if (err3 == 0)
|
||||||
|
|
|
||||||
|
|
@ -264,6 +264,7 @@ struct snd_use_case_mgr {
|
||||||
|
|
||||||
/* tree with macros */
|
/* tree with macros */
|
||||||
snd_config_t *macros;
|
snd_config_t *macros;
|
||||||
|
int macro_hops;
|
||||||
|
|
||||||
/* local library configuration */
|
/* local library configuration */
|
||||||
snd_config_t *local_config;
|
snd_config_t *local_config;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue