From 6320792f1b25551ee4db57384ccfbb91c2afa13f Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Sun, 10 May 2026 22:46:40 -0400 Subject: [PATCH] options/m_property: try to get constricted type in m_property_do When setting properties via M_PROPERTY_SET_NODE, the property value is limited by static declared range. However, some properties like volume handle dynamic M_PROPERTY_GET_CONSTRICTED_TYPE requests and return runtime determined limits. M_PROPERTY_SET_NODE in this case does not respect that limit, and allows setting to a value out of range. Fix this by always trying to use M_PROPERTY_GET_CONSTRICTED_TYPE first so that the dynamic limits will be used. --- options/m_property.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/options/m_property.c b/options/m_property.c index 4989e3b065..f0293efbf4 100644 --- a/options/m_property.c +++ b/options/m_property.c @@ -138,6 +138,13 @@ int m_property_do(struct mp_log *log, const struct m_property *prop_list, if (r <= 0) return r; mp_assert(opt.type); + // Make sure dynamic range from properties with M_PROPERTY_GET_CONSTRICTED_TYPE is applied + struct m_option copt = {0}; + r = do_action(prop_list, name, M_PROPERTY_GET_CONSTRICTED_TYPE, &copt, ctx); + if (r == M_PROPERTY_OK) { + opt.min = copt.min; + opt.max = copt.max; + } switch (action) { case M_PROPERTY_FIXED_LEN_PRINT: