[FFmpeg-cvslog] asfdec: free AVDictionaries properly when closing the demuxer

Alexandra Hájková git at videolan.org
Sun Aug 2 11:17:54 CEST 2015


ffmpeg | branch: master | Alexandra Hájková <alexandra.khirnova at gmail.com> | Thu Jul 30 19:59:25 2015 +0200| [cd4d9df22738e6f147521ccb72c7930db6050914] | committer: Anton Khirnov

asfdec: free AVDictionaries properly when closing the demuxer

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavformat/asfdec.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 37d91e0..72c5916 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;



More information about the ffmpeg-cvslog mailing list