[FFmpeg-devel] [PATCH 2/5] avformat:hlsenc.c: fix memory leak in fmp4 mode.

Charles Liu liuchh83 at gmail.com
Thu Oct 11 11:56:44 EEST 2018


Signed-off-by: Charles Liu <liuchh83 at gmail.com>
---
 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 3ccd8756f6..c322b5a48f 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2205,6 +2205,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
                 avio_flush(oc->pb);
                 range_length = avio_close_dyn_buf(oc->pb, &buffer);
                 avio_write(vs->out, buffer, range_length);
+                av_free(buffer);
                 vs->init_range_length = range_length;
                 avio_open_dyn_buf(&oc->pb);
                 vs->packets_written = 0;
-- 
2.19.1



More information about the ffmpeg-devel mailing list