[FFmpeg-cvslog] avformat/utils: fix memory leak in avformat_free_context

Steven Siloti git at videolan.org
Sun Sep 10 03:09:56 EEST 2017


ffmpeg | branch: release/3.3 | Steven Siloti <ssiloti at bittorrent.com> | Tue Jul 18 11:26:39 2017 -0700| [fd871e24e65b2d3d91b060b5e878f37c9ee5cdff] | committer: Michael Niedermayer

avformat/utils: fix memory leak in avformat_free_context

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

Signed-off-by: Steven Siloti <ssiloti at bittorrent.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 949debd1d1df3a96315b3a3083831162845c1188)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index a9f8cf6f84..ff55fc8d97 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4199,8 +4199,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);
 }
 



More information about the ffmpeg-cvslog mailing list