[FFmpeg-cvslog] avformat/utils: free AVStream.codec properly in free_stream()

Aaron Levinson git at videolan.org
Wed May 17 23:04:08 EEST 2017


ffmpeg | branch: release/3.0 | Aaron Levinson <alevinsn at aracnet.com> | Thu Apr 20 23:30:13 2017 -0700| [c54a76bf714b07cf316da06ffeac1a1d753a15f3] | committer: James Almer

avformat/utils: free AVStream.codec properly in free_stream()

Fixes memory leaks.

Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit b9d2005ea5d6837917a69bc2b8e98f5695f54e39)

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

 libavformat/utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index b199ff23bf..f90aeb20c1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3728,9 +3728,7 @@ static void free_stream(AVStream **pst)
     av_dict_free(&st->metadata);
     av_freep(&st->probe_data.buf);
     av_freep(&st->index_entries);
-    av_freep(&st->codec->extradata);
-    av_freep(&st->codec->subtitle_header);
-    av_freep(&st->codec);
+    avcodec_free_context(&st->codec);
     av_freep(&st->priv_data);
     if (st->info)
         av_freep(&st->info->duration_error);



More information about the ffmpeg-cvslog mailing list