]> git.sesse.net Git - ffmpeg/commitdiff
avformat/hlsenc: Fix memleak when using single_file
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 11 Sep 2019 12:36:36 +0000 (14:36 +0200)
committerSteven Liu <lq@chinaffmpeg.org>
Sat, 14 Sep 2019 01:55:49 +0000 (09:55 +0800)
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@onvideo.cn>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/hlsenc.c

index 8491d84b708bfb99e5e03c1b7f88945ab005293c..5d0a8fc76c042eed5b601d78db73d1305e06af76 100644 (file)
@@ -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;
             }