summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2013-12-16 14:17:50 +0100
committerStefano Sabatini <stefasab@gmail.com>2013-12-26 11:35:26 +0100
commite2b54464c6a9de5d6b9ad4307696b0215d5e05a4 (patch)
tree83869c088e3f3d1e176b5bed30985c3e6eb57a1d /libavutil
parent165f96cd2d687122748f862a0bc6e9908fe3d5d2 (diff)
lavu/opt: fix range check logic in set_format()
In particular, allow to reject undefined values. Previously the code was only accepting values in the range -1 .. NB_FORMATS-1.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/opt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 0c7f442bc8..723b443a16 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -559,8 +559,8 @@ static int set_format(void *obj, const char *name, int fmt, int search_flags,
} else
#endif
{
- min = FFMIN(o->min, -1);
- max = FFMAX(o->max, nb_fmts-1);
+ min = FFMAX(o->min, -1);
+ max = FFMIN(o->max, nb_fmts-1);
}
if (fmt < min || fmt > max) {
av_log(obj, AV_LOG_ERROR,