From 1c3050245ea7660bec230c397ca1046bdf083bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Thu, 9 Feb 2023 15:36:30 +0100 Subject: [PATCH] LibDSP: Don't crash on out-of-bounds parameter value We can just clamp instead. --- Userland/Libraries/LibDSP/ProcessorParameter.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibDSP/ProcessorParameter.h b/Userland/Libraries/LibDSP/ProcessorParameter.h index ed6536d6aa1..d0d6a8c176e 100644 --- a/Userland/Libraries/LibDSP/ProcessorParameter.h +++ b/Userland/Libraries/LibDSP/ProcessorParameter.h @@ -137,8 +137,7 @@ public: ParameterFixedPoint default_value() const { return m_default_value; } void set_value(ParameterFixedPoint value) { - VERIFY(value <= m_max_value && value >= m_min_value); - Detail::ProcessorParameterSingleValue::set_value(value); + Detail::ProcessorParameterSingleValue::set_value(value.clamp(min_value(), max_value())); } private: