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:
Wim Taymans 2026-03-16 12:19:57 +01:00
parent 90fd6fbc65
commit 653b8703bc

View file

@ -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;
}