[FFmpeg-cvslog] avfilter/af_channelsplit: fix memory leak

LuMingYin git at videolan.org
Mon Apr 15 05:46:16 EEST 2024


ffmpeg | branch: master | LuMingYin <lumingyindetect at 163.com> | Fri Apr 12 17:19:23 2024 +0800| [5e380bcdb13dd47ce9c358a4edb281f05fde3f24] | committer: Zhao Zhili

avfilter/af_channelsplit: fix memory leak

Signed-off-by: LuMingYin <lumingyindetect at 163.com>
Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>

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

 libavfilter/af_channelsplit.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_channelsplit.c b/libavfilter/af_channelsplit.c
index d18d91dcb6..1c4e815c6e 100644
--- a/libavfilter/af_channelsplit.c
+++ b/libavfilter/af_channelsplit.c
@@ -163,8 +163,10 @@ static int filter_frame(AVFilterLink *outlink, AVFrame *buf)
 
     buf_out->data[0] = buf_out->extended_data[0] = buf_out->extended_data[s->map[i]];
     ret = av_channel_layout_from_mask(&buf_out->ch_layout, 1ULL << channel);
-    if (ret < 0)
+    if (ret < 0) {
+        av_frame_free(&buf_out);
         return ret;
+    }
 
     return ff_filter_frame(ctx->outputs[i], buf_out);
 }



More information about the ffmpeg-cvslog mailing list