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

Michael Niedermayer git at videolan.org
Sun Nov 30 21:58:53 CET 2014


ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 16 04:02:56 2014 +0100| [3bb48296ef0f54fad7d73c93a36e676ba391b037] | 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

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

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

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index cc142fa..3fceb08 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -329,9 +329,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);
     hls_append_segment(hls, hls->duration);
+    avformat_free_context(oc);
+    hls->avf = NULL;
     hls_window(s, 1);
 
     hls_free_segments(hls);



More information about the ffmpeg-cvslog mailing list