summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--options/m_option.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/options/m_option.c b/options/m_option.c
index 4dedfe476e..0acdc55b0a 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -894,7 +894,8 @@ static int clamp_double(const m_option_t *opt, void *val)
v = opt->min;
r = M_OPT_OUT_OF_RANGE;
}
- if (!isfinite(v)) {
+ // (setting max/min to INFINITY/-INFINITY is allowed)
+ if (!isfinite(v) && v != opt->max && v != opt->min) {
v = opt->min;
r = M_OPT_OUT_OF_RANGE;
}