diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-09 05:01:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-09 10:35:13 +0200 |
commit | 37bb6004059c15f6a17f38b4ab5c5f5d2f61c087 (patch) | |
tree | 58e3c2145414d5d13607123f50f7bdd56037e19d /libavutil/opt.c | |
parent | 4888932c4d3ac68c26f44d7adf1e22e0d7ed8808 (diff) | |
download | ffmpeg-37bb6004059c15f6a17f38b4ab5c5f5d2f61c087.tar.gz |
avutil/opt: Fix max/min checking in av_opt_set() for AV_OPT_TYPE_VIDEO_RATE
Fixes Ticket5618
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 7e9ad8f4b2..cd16bd1d3f 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -462,8 +462,13 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags) return set_string_number(obj, target_obj, o, val, dst); case AV_OPT_TYPE_IMAGE_SIZE: return set_string_image_size(obj, o, val, dst); - case AV_OPT_TYPE_VIDEO_RATE: - return set_string_video_rate(obj, o, val, dst); + case AV_OPT_TYPE_VIDEO_RATE: { + AVRational tmp; + ret = set_string_video_rate(obj, o, val, &tmp); + if (ret < 0) + return ret; + return write_number(obj, o, dst, 1, tmp.den, tmp.num); + } case AV_OPT_TYPE_PIXEL_FMT: return set_string_pixel_fmt(obj, o, val, dst); case AV_OPT_TYPE_SAMPLE_FMT: |