]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/af_join: fix possible memory leaks
authorPaul B Mahol <onemda@gmail.com>
Mon, 21 Oct 2019 14:03:22 +0000 (16:03 +0200)
committerPaul B Mahol <onemda@gmail.com>
Mon, 21 Oct 2019 14:04:48 +0000 (16:04 +0200)
Allocation of input frames is independent from
allocation of new input pads.

libavfilter/af_join.c

index e5d178c1cedd8afd0b62a53992b864440a32fc47..ea03b60d67f401245fea8ed1eecff4220ed7a67f 100644 (file)
@@ -207,9 +207,12 @@ static av_cold void join_uninit(AVFilterContext *ctx)
     JoinContext *s = ctx->priv;
     int i;
 
+    for (i = 0; i < s->inputs && s->input_frames; i++) {
+        av_frame_free(&s->input_frames[i]);
+    }
+
     for (i = 0; i < ctx->nb_inputs; i++) {
         av_freep(&ctx->input_pads[i].name);
-        av_frame_free(&s->input_frames[i]);
     }
 
     av_freep(&s->channels);