diff mbox series

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

Message ID 20201220190012.24321-1-cus@passwd.hu
State Accepted
Commit 6d3b70c27ef1639784fdb3382e5a06b1afa3fe3e
Headers show
Series [FFmpeg-devel] avfilter/vf_framerate: fix infinite loop with 1-frame input | 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

Marton Balint Dec. 20, 2020, 7 p.m. UTC
Fixes infinite loop in:
ffmpeg -f lavfi -i testsrc=d=0.04 -vf framerate=50 -f null none

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

Comments

Marton Balint Dec. 25, 2020, 8:54 p.m. UTC | #1
On Sun, 20 Dec 2020, Marton Balint wrote:

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

Ping, will apply soon.

Regards,
Marton

>
> Signed-off-by: Marton Balint <cus@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
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

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;