mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-19 05:33:49 -04:00
filter-graph: fix up def/min/max values for lv2
lv2 filters can return NAN for the min/max and default values when not specified. Handle them so that we don't end up clamping NAN numbers. Fixes #5166
This commit is contained in:
parent
90fd6fbc65
commit
653b8703bc
1 changed files with 11 additions and 0 deletions
|
|
@ -560,6 +560,17 @@ static const struct spa_fga_descriptor *lv2_plugin_make_desc(void *plugin, const
|
|||
fp->min = mins[i];
|
||||
fp->max = maxes[i];
|
||||
fp->def = controls[i];
|
||||
|
||||
if (isnan(fp->min))
|
||||
fp->min = -FLT_MAX;
|
||||
if (isnan(fp->max))
|
||||
fp->max = FLT_MAX;
|
||||
if (isnan(fp->def))
|
||||
fp->def = 0.0f;
|
||||
if (fp->max <= fp->min)
|
||||
fp->max = FLT_MAX;
|
||||
if (fp->def <= fp->min)
|
||||
fp->min = -FLT_MAX;
|
||||
}
|
||||
return &desc->desc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue