diff options
author | Alexandra Hájková <alexandra.khirnova@gmail.com> | 2015-07-30 19:59:25 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-07-31 07:23:20 +0200 |
commit | cd4d9df22738e6f147521ccb72c7930db6050914 (patch) | |
tree | d273aeb6a595454bdcde4b69962c4169328b3821 | |
parent | 90e648c508fa6b97587ce62699a1449123f7d285 (diff) | |
download | ffmpeg-cd4d9df22738e6f147521ccb72c7930db6050914.tar.gz |
asfdec: free AVDictionaries properly when closing the demuxer
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavformat/asfdec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 37d91e0c75..72c59168a8 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -1453,10 +1453,12 @@ static int asf_read_close(AVFormatContext *s) ASFContext *asf = s->priv_data; int i; - for (i = 0; i < asf->nb_streams; i++) { - av_free_packet(&asf->asf_st[i]->pkt.avpkt); - av_freep(&asf->asf_st[i]); + for (i = 0; i < ASF_MAX_STREAMS; i++) { av_dict_free(&asf->asf_sd[i].asf_met); + if (i < asf->nb_streams) { + av_free_packet(&asf->asf_st[i]->pkt.avpkt); + av_freep(&asf->asf_st[i]); + } } asf->nb_streams = 0; |