From 07f8b647547cadb61d0677200faeaf1498b8377e Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 17 Aug 2016 21:48:45 +0200 Subject: m_option: add mechanism to allow inf/-inf float options Used by the next commit. --- options/m_option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'options') 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; } -- cgit v1.2.3