[FFmpeg-cvslog] avformat/hlsenc: Free context after hls_append_segment

Michael Niedermayer git at videolan.org
Tue Dec 16 00:27:14 CET 2014


ffmpeg | branch: release/1.2 | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 16 04:02:56 2014 +0100| [5284d17562f3a50194cb01dcc890307de3ba99bd] | committer: Michael Niedermayer

avformat/hlsenc: Free context after hls_append_segment

Fixes reading uninitialized memory

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 530eb6acf8ee867bf00728bf7efaf505da107e17)

Conflicts:

	libavformat/hlsenc.c
(cherry picked from commit 0ac22f043bee2f1c4daf5e1044b014326325d929)

Conflicts:

	libavformat/hlsenc.c
(cherry picked from commit 134d3e1c0331462ea94c78a5e13a63b20d283653)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/hlsenc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 18914c0..578f04d 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -305,9 +305,10 @@ static int hls_write_trailer(struct AVFormatContext *s)
 
     av_write_trailer(oc);
     avio_closep(&oc->pb);
-    avformat_free_context(oc);
     av_free(hls->basename);
     append_entry(hls, hls->duration);
+    avformat_free_context(oc);
+    hls->avf = NULL;
     hls_window(s, 1);
 
     free_entries(hls);



More information about the ffmpeg-cvslog mailing list