]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/hlsenc.c
Merge commit '3cec81f4d4f26b62bc2d22bb450bbf51ec3a7f09'
[ffmpeg] / libavformat / hlsenc.c
index 0525e70b30e980bc870f81bf775336d0b5d39dc6..e13f438a2f5df6f60dfbfd8bf53c884235f32ba6 100644 (file)
@@ -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);