[vlc-devel] [PATCH 1/3] variables: make sure range configuration is valid
Zhao Zhili
quinkblack at foxmail.com
Tue Aug 28 05:50:04 CEST 2018
---
src/misc/variables.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/misc/variables.c b/src/misc/variables.c
index d533642..9bd6866 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -450,6 +450,10 @@ int (var_Change)(vlc_object_t *p_this, const char *psz_name, int i_action, ...)
assert(p_var->ops->pf_free == FreeDummy);
p_var->min = va_arg(ap, vlc_value_t);
p_var->max = va_arg(ap, vlc_value_t);
+ assert(((p_var->i_type & VLC_VAR_TYPE) == VLC_VAR_INTEGER &&
+ p_var->min.i_int < p_var->max.i_int) ||
+ ((p_var->i_type & VLC_VAR_TYPE) == VLC_VAR_FLOAT &&
+ p_var->min.f_float < p_var->max.f_float));
break;
case VLC_VAR_SETSTEP:
assert(p_var->ops->pf_free == FreeDummy);
--
2.9.5
More information about the vlc-devel
mailing list