diff mbox series

[FFmpeg-devel,01/13] lavfi/buffersink: avoid leaking peeked_frame on uninit

Message ID 20231123191524.11296-3-anton@khirnov.net
State Accepted
Commit c6483f1c2ac46d13ba1f2b547291b492a546f75a
Headers show
Series [FFmpeg-devel,01/13] lavfi/buffersink: avoid leaking peeked_frame on uninit | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Nov. 23, 2023, 7:14 p.m. UTC
---
 libavfilter/buffersink.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Paul B Mahol Nov. 23, 2023, 10:16 p.m. UTC | #1
LGTM
Nicolas George Nov. 27, 2023, 9:45 a.m. UTC | #2
Anton Khirnov (12023-11-23):
> ---
>  libavfilter/buffersink.c | 9 +++++++++
>  1 file changed, 9 insertions(+)

LGTM, thanks.

Regards,
diff mbox series

Patch

diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
index ca2af1bc07..3da3331159 100644
--- a/libavfilter/buffersink.c
+++ b/libavfilter/buffersink.c
@@ -164,6 +164,13 @@  static av_cold int common_init(AVFilterContext *ctx)
     return 0;
 }
 
+static void uninit(AVFilterContext *ctx)
+{
+    BufferSinkContext *buf = ctx->priv;
+
+    av_frame_free(&buf->peeked_frame);
+}
+
 static int activate(AVFilterContext *ctx)
 {
     BufferSinkContext *buf = ctx->priv;
@@ -385,6 +392,7 @@  const AVFilter ff_vsink_buffer = {
     .priv_size     = sizeof(BufferSinkContext),
     .priv_class    = &buffersink_class,
     .init          = common_init,
+    .uninit        = uninit,
     .activate      = activate,
     FILTER_INPUTS(ff_video_default_filterpad),
     .outputs       = NULL,
@@ -397,6 +405,7 @@  const AVFilter ff_asink_abuffer = {
     .priv_class    = &abuffersink_class,
     .priv_size     = sizeof(BufferSinkContext),
     .init          = common_init,
+    .uninit        = uninit,
     .activate      = activate,
     FILTER_INPUTS(ff_audio_default_filterpad),
     .outputs       = NULL,