m_option: use isfinite() instead of isnormal()

This accidentally rejected d==0. We can actually deal with sub-normals
fine, we just want to exclude nan and infinity (although infinity is
already accounted for, but anyway).
This commit is contained in:
wm4 2014-06-01 17:23:56 +02:00
parent a192f32a3a
commit 2bc871b577
1 changed files with 1 additions and 1 deletions

View File

@ -1707,7 +1707,7 @@ static int parse_color(struct mp_log *log, const m_option_t *opt,
for (int n = 0; n < num; n++) {
bstr rest;
double d = bstrtod(comp_str[n], &rest);
if (rest.len || !comp_str[n].len || d < 0 || d > 1 || !isnormal(d))
if (rest.len || !comp_str[n].len || d < 0 || d > 1 || !isfinite(d))
goto error;
comp[n] = d;
}