aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Levinson <alevinsn@aracnet.com>2017-04-20 23:30:13 -0700
committerJames Almer <jamrial@gmail.com>2017-05-16 11:33:35 -0300
commit9ebbb29ad61db72cebab31a6a68970ca8063bcf8 (patch)
treeb8432422ba245562a9bacfea8290a34f99534cd9
parent1564125e4eb1a1a78d46f30c6638b42f599cc8a5 (diff)
downloadffmpeg-9ebbb29ad61db72cebab31a6a68970ca8063bcf8.tar.gz
avformat/utils: free AVStream.codec properly in free_stream()
Fixes memory leaks. Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit b9d2005ea5d6837917a69bc2b8e98f5695f54e39)
-rw-r--r--libavformat/utils.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 17bbdb44be..d71aca851b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3994,9 +3994,7 @@ static void free_stream(AVStream **pst)
av_freep(&st->index_entries);
#if FF_API_LAVF_AVCTX
FF_DISABLE_DEPRECATION_WARNINGS
- av_freep(&st->codec->extradata);
- av_freep(&st->codec->subtitle_header);
- av_freep(&st->codec);
+ avcodec_free_context(&st->codec);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
av_freep(&st->priv_data);