From 653b8703bc0b532a352352b1b16b11940efc79c1 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 16 Mar 2026 12:19:57 +0100 Subject: [PATCH] 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 --- spa/plugins/filter-graph/plugin_lv2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spa/plugins/filter-graph/plugin_lv2.c b/spa/plugins/filter-graph/plugin_lv2.c index 712b728e2..b2d3fc6cc 100644 --- a/spa/plugins/filter-graph/plugin_lv2.c +++ b/spa/plugins/filter-graph/plugin_lv2.c @@ -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; }