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-19 23:37:49 -0300
commit0109a152a1651d520788000bed5ce096b515de3d (patch)
tree1b45bf3670d5381837a97ed3148a7e82a2e56ede
parent1c302b606e0fd86dd0ac1ff66e56a1f7d321d7e1 (diff)
downloadffmpeg-0109a152a1651d520788000bed5ce096b515de3d.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 abc90c3c70..a88d9598dc 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3683,9 +3683,7 @@ void ff_free_stream(AVFormatContext *s, AVStream *st) {
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);