[FFmpeg-cvslog] avformat/hlsenc: Fix memleak when using single_file

Andreas Rheinhardt git at videolan.org
Sat Sep 14 05:02:35 EEST 2019


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Wed Sep 11 14:36:36 2019 +0200| [1a066d87e3ea2fb8139af9181b3abf0f0a16a208] | committer: Steven Liu

avformat/hlsenc: Fix memleak when using single_file

This commit fixes a memleak in the hls muxer when one uses a single file
as output. It has been forgotten to free the temporary buffers used to write
the packets so that the size of the leaks basically amounts to the size
of the output file. This commit adds the necessary free.

Reviewed-by: Steven Liu <lq at onvideo.cn>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 8491d84b70..5d0a8fc76c 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2366,6 +2366,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
 
         if (hls->flags & HLS_SINGLE_FILE) {
             ret = flush_dynbuf(vs, &range_length);
+            av_freep(&vs->temp_buffer);
             if (ret < 0) {
                 return ret;
             }



More information about the ffmpeg-cvslog mailing list