[FFmpeg-devel] [PATCH] avformat/utils: fix freeing packet queue in avformat_free_context

Steven Siloti ssiloti at bittorrent.com
Tue Jul 18 22:26:29 EEST 2017


The packet queue is referenced in internal so it needs to be flushed
before the internal structure is freed.

Signed-off-by: Steven Siloti <ssiloti at bittorrent.com>
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 38d247c6cd..58283616dc 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4333,8 +4333,8 @@ void avformat_free_context(AVFormatContext *s)
     av_dict_free(&s->metadata);
     av_dict_free(&s->internal->id3v2_meta);
     av_freep(&s->streams);
-    av_freep(&s->internal);
     flush_packet_queue(s);
+    av_freep(&s->internal);
     av_free(s);
 }
 
-- 
2.13.0.windows.1



More information about the ffmpeg-devel mailing list