Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavutil/opt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 7a84a18bb59..cc4832daeee 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -607,8 +607,8 @@ static int set_string_fmt(void *obj, const AVOption *o, 
const char *val, uint8_t
         }
     }
 
-    min = FFMAX(o->min, -1);
-    max = FFMIN(o->max, fmt_nb-1);
+    min = FFMAXI(lrint(o->min), -1);
+    max = FFMINI(lrint(o->max), fmt_nb-1);
 
     // hack for compatibility with old ffmpeg
     if(min == 0 && max == 0) {
@@ -958,8 +958,8 @@ static int set_format(void *obj, const char *name, int fmt, 
int search_flags,
     if (ret < 0)
         return ret;
 
-    min = FFMAX(o->min, -1);
-    max = FFMIN(o->max, nb_fmts-1);
+    min = FFMAXI(lrint(o->min), -1);
+    max = FFMINI(lrint(o->max), nb_fmts-1);
 
     if (fmt < min || fmt > max) {
         av_log(obj, AV_LOG_ERROR,
-- 
2.49.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to