diff mbox series

[FFmpeg-devel] avfilter/yadif: Fix time base for large denominators

Message ID 20210525155708.349798-1-tom@jwplayer.com
State Accepted
Commit 8205f32663ec492200cdd47216719be15e92fcdb
Headers show
Series [FFmpeg-devel] avfilter/yadif: Fix time base for large denominators | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Tom Boshoven May 25, 2021, 3:57 p.m. UTC
This fixes an issue where the yadif filter could cause the timebase denominator to overflow.

Signed-off-by: Tom Boshoven <tom@jwplayer.com>
---
 libavfilter/vf_yadif.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Michael Niedermayer May 27, 2021, 3:45 p.m. UTC | #1
On Tue, May 25, 2021 at 11:57:08AM -0400, Tom Boshoven wrote:
> This fixes an issue where the yadif filter could cause the timebase denominator to overflow.
> 
> Signed-off-by: Tom Boshoven <tom@jwplayer.com>
> ---
>  libavfilter/vf_yadif.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

will apply

thx

[...]
diff mbox series

Patch

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index a6942a2aa2..91cc79ecc3 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -293,8 +293,7 @@  static int config_output(AVFilterLink *outlink)
     AVFilterContext *ctx = outlink->src;
     YADIFContext *s = ctx->priv;
 
-    outlink->time_base.num = ctx->inputs[0]->time_base.num;
-    outlink->time_base.den = ctx->inputs[0]->time_base.den * 2;
+    outlink->time_base = av_mul_q(ctx->inputs[0]->time_base, (AVRational){1, 2});
     outlink->w             = ctx->inputs[0]->w;
     outlink->h             = ctx->inputs[0]->h;