diff options
author | James Almer <jamrial@gmail.com> | 2022-03-16 23:41:55 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-16 23:43:07 -0300 |
commit | c834083861a5e81595a2834cb11cd329d46f6a65 (patch) | |
tree | 3e82d7918624340ad0d3368ee2a4c77353d071a6 /libavcodec/setts_bsf.c | |
parent | ccb81acc3d1beb2235ff29bbc05e60db41de9039 (diff) | |
download | ffmpeg-c834083861a5e81595a2834cb11cd329d46f6a65.tar.gz |
avcodec/setts_bsf: fix setting output timebase
Set a valid max value for the option, and also check numerator before
assuming the value is useful.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/setts_bsf.c')
-rw-r--r-- | libavcodec/setts_bsf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/setts_bsf.c b/libavcodec/setts_bsf.c index 69977bc166..b7732214ee 100644 --- a/libavcodec/setts_bsf.c +++ b/libavcodec/setts_bsf.c @@ -145,7 +145,7 @@ static int setts_init(AVBSFContext *ctx) } } - if (s->time_base.den) + if (s->time_base.num > 0 && s->time_base.den > 0) ctx->time_base_out = s->time_base; s->frame_number= 0; @@ -259,7 +259,7 @@ static const AVOption options[] = { { "pts", "set expression for packet PTS", OFFSET(pts_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS }, { "dts", "set expression for packet DTS", OFFSET(dts_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS }, { "duration", "set expression for packet duration", OFFSET(duration_str), AV_OPT_TYPE_STRING, {.str="DURATION"}, 0, 0, FLAGS }, - { "time_base", "set output timebase", OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, 0, FLAGS }, + { "time_base", "set output timebase", OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS }, { NULL }, }; |