[FFmpeg-cvslog] fftools/ffmpeg_filter: only set framerate for video

Anton Khirnov git at videolan.org
Fri Dec 22 12:43:50 EET 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Dec 15 02:25:41 2023 +0100| [dc2fc5a919608e3937137f11548f4be5ee99523d] | committer: Anton Khirnov

fftools/ffmpeg_filter: only set framerate for video

Otherwise an unitialized stack value would be copied to FPSConvContext.
As it's then never used, it tends not to be a problem in practice,
however it is UB and some compilers warn about it.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc2fc5a919608e3937137f11548f4be5ee99523d
---

 fftools/ffmpeg_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 87ab2ca976..c1c3014453 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -2017,9 +2017,9 @@ static int choose_out_timebase(OutputFilterPriv *ofp, AVFrame *frame)
     if (!(tb.num > 0 && tb.den > 0))
         tb = frame->time_base;
 
+    fps->framerate     = fr;
 finish:
     ofp->tb_out        = tb;
-    fps->framerate     = fr;
     ofp->tb_out_locked = 1;
 
     return 0;



More information about the ffmpeg-cvslog mailing list