[FFmpeg-devel] [PATCH] avfilter/vf_framerate: fix infinite loop with 1-frame input

Marton Balint cus at passwd.hu
Sun Dec 20 21:00:12 EET 2020


Fixes infinite loop in:
ffmpeg -f lavfi -i testsrc=d=0.04 -vf framerate=50 -f null none

Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavfilter/vf_framerate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index 6c8d01c94b..f5085705a4 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -170,7 +170,9 @@ static int process_work_frame(AVFilterContext *ctx)
         return 0;
 
     if (!s->f0) {
-        s->work = av_frame_clone(s->f1);
+        av_assert1(s->flush);
+        s->work = s->f1;
+        s->f1 = NULL;
     } else {
         if (work_pts >= s->pts1 + s->delta && s->flush)
             return 0;
-- 
2.26.2



More information about the ffmpeg-devel mailing list