Skip to content

Commit d87113f

Browse files
guidocellaDudemanguy
authored andcommitted
m_option: fix float option values <= 0
FLT_MIN is a small positive number (1.175494e-38), so the check v < FLT_MIN introduced in 0e7f9c3 made all 0 and negative float option values error, e.g. panscan=0 or video-align-y=-1. Fixes 0e7f9c3, fixes mpv-player#15728.
1 parent a23b11a commit d87113f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

options/m_option.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,8 +1147,8 @@ static int clamp_float(const m_option_t *opt, double *val)
11471147
v = FLT_MAX;
11481148
r = M_OPT_OUT_OF_RANGE;
11491149
}
1150-
if (isfinite(v) && v < FLT_MIN) {
1151-
v = FLT_MIN;
1150+
if (isfinite(v) && v < -FLT_MAX) {
1151+
v = -FLT_MAX;
11521152
r = M_OPT_OUT_OF_RANGE;
11531153
}
11541154
*val = v;

0 commit comments

Comments
 (0)