protect against unsafe gain changes

This commit is contained in:
onyx 2024-07-01 03:40:33 +01:00
parent adaf3a7837
commit 815a19210b

View File

@ -240,7 +240,10 @@ void parse_command(T_VBVMR_INTERFACE *vmr, char *command)
get(vmr, command, &res); get(vmr, command, &res);
if (res.type == FLOAT_T) if (res.type == FLOAT_T)
{ {
set_parameter_float(vmr, command, 1 - res.val.f); if (res.val.f == 1 || res.val.f == 0)
set_parameter_float(vmr, command, 1 - res.val.f);
else
log_warn("%s does not appear to be a boolean parameter", command);
} }
return; return;
} }