summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-16 04:02:56 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-16 04:32:54 +0100
commit530eb6acf8ee867bf00728bf7efaf505da107e17 (patch)
tree422f9257c045306583ae7c24135b39c005631118 /libavformat/hlsenc.c
parentce80f9fee97160049687bbbef4eb31a68166c3ee (diff)
downloadffmpeg-530eb6acf8ee867bf00728bf7efaf505da107e17.tar.gz
avformat/hlsenc: Free context after hls_append_segment
Fixes reading uninitialized memory Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 0525e70b30..e13f438a2f 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -389,9 +389,10 @@ static int hls_write_trailer(struct AVFormatContext *s)
av_write_trailer(oc);
hls->size = avio_tell(hls->avf->pb) - hls->start_pos;
avio_closep(&oc->pb);
- avformat_free_context(oc);
av_free(hls->basename);
hls_append_segment(hls, hls->duration, hls->start_pos, hls->size);
+ avformat_free_context(oc);
+ hls->avf = NULL;
hls_window(s, 1);
hls_free_segments(hls);