[FFmpeg-cvslog] libavformat/lafdec: free data

Michael Niedermayer git at videolan.org
Wed Feb 1 21:24:09 EET 2023


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Jan 30 23:18:49 2023 +0100| [f4b4e16641184b2414e5822c49fa5f6f9a57f2fb] | committer: Michael Niedermayer

libavformat/lafdec: free data

Fixes: memleak

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/lafdec.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavformat/lafdec.c b/libavformat/lafdec.c
index a1775e1b69..d6ef8415a9 100644
--- a/libavformat/lafdec.c
+++ b/libavformat/lafdec.c
@@ -252,6 +252,15 @@ again:
     return 0;
 }
 
+static int laf_read_close(AVFormatContext *ctx)
+{
+    LAFContext *s = ctx->priv_data;
+
+    av_freep(&s->data);
+
+    return 0;
+}
+
 static int laf_read_seek(AVFormatContext *ctx, int stream_index,
                          int64_t timestamp, int flags)
 {
@@ -269,7 +278,9 @@ const AVInputFormat ff_laf_demuxer = {
     .read_probe     = laf_probe,
     .read_header    = laf_read_header,
     .read_packet    = laf_read_packet,
+    .read_close     = laf_read_close,
     .read_seek      = laf_read_seek,
     .extensions     = "laf",
     .flags          = AVFMT_GENERIC_INDEX,
+    .flags_internal = FF_FMT_INIT_CLEANUP,
 };



More information about the ffmpeg-cvslog mailing list