From: Alexandra Hájková Date: Thu, 30 Jul 2015 17:59:25 +0000 (+0200) Subject: asfdec: free AVDictionaries properly when closing the demuxer X-Git-Tag: android-x86-7.1-r1~252^2~2145 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=cd4d9df22738e6f147521ccb72c7930db6050914;p=android-x86%2Fexternal-ffmpeg.git asfdec: free AVDictionaries properly when closing the demuxer Signed-off-by: Anton Khirnov --- 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;