Browse code

avformat/hlsenc: Free context after hls_append_segment

Fixes reading uninitialized memory

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

Conflicts:

libavformat/hlsenc.c

Michael Niedermayer authored on 2014/11/16 12:02:56
Showing 1 changed files
... ...
@@ -329,9 +329,10 @@ static int hls_write_trailer(struct AVFormatContext *s)
329 329
 
330 330
     av_write_trailer(oc);
331 331
     avio_closep(&oc->pb);
332
-    avformat_free_context(oc);
333 332
     av_free(hls->basename);
334 333
     hls_append_segment(hls, hls->duration);
334
+    avformat_free_context(oc);
335
+    hls->avf = NULL;
335 336
     hls_window(s, 1);
336 337
 
337 338
     hls_free_segments(hls);