[FFmpeg-cvslog] lavf/utils: fix mem leak

Lukasz Marek git at videolan.org
Thu Apr 10 04:03:28 CEST 2014


ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki2 at gmail.com> | Wed Apr  9 22:43:48 2014 +0200| [e1c48e3593fb2e848fd7fb910ea3d807941f8e91] | committer: Michael Niedermayer

lavf/utils: fix mem leak

Calling avformat_free_context() right after avformat_alloc_output_context2()
leaved option's default values not freed.
Options were freed only in av_write_trailer().

Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 207501a..25736f9 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3546,6 +3546,8 @@ void avformat_free_context(AVFormatContext *s)
     av_opt_free(s);
     if (s->iformat && s->iformat->priv_class && s->priv_data)
         av_opt_free(s->priv_data);
+    if (s->oformat && s->oformat->priv_class && s->priv_data)
+        av_opt_free(s->priv_data);
 
     for (i = s->nb_streams - 1; i >= 0; i--) {
         ff_free_stream(s, s->streams[i]);



More information about the ffmpeg-cvslog mailing list