Skip to content

Commit

Permalink
m_option: fix float option values <= 0
Browse files Browse the repository at this point in the history
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 #15728.
  • Loading branch information
guidocella authored and Dudemanguy committed Jan 24, 2025
1 parent a23b11a commit d87113f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions options/m_option.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,8 +1147,8 @@ static int clamp_float(const m_option_t *opt, double *val)
v = FLT_MAX;
r = M_OPT_OUT_OF_RANGE;
}
if (isfinite(v) && v < FLT_MIN) {
v = FLT_MIN;
if (isfinite(v) && v < -FLT_MAX) {
v = -FLT_MAX;
r = M_OPT_OUT_OF_RANGE;
}
*val = v;
Expand Down

0 comments on commit d87113f

Please sign in to comment.