[FFmpeg-cvslog] avformat/avidec: Fix memleak with dv in avi

Michael Niedermayer git at videolan.org
Wed Sep 28 15:50:15 EEST 2016


ffmpeg | branch: release/3.1 | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep 25 11:56:11 2016 +0200| [8834e080c20d3d23c3ffe779371359f9b9b835ec] | committer: Michael Niedermayer

avformat/avidec: Fix memleak with dv in avi

Found-by: 连一汉 <lianyihan at 360.cn>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit b98dafe04564d5fe3e5bf5073d871dd93a4a62de)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/avidec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 858011c..26b0234 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -605,9 +605,13 @@ static int avi_read_header(AVFormatContext *s)
                 ast = s->streams[0]->priv_data;
                 av_freep(&s->streams[0]->codecpar->extradata);
                 av_freep(&s->streams[0]->codecpar);
+                av_freep(&s->streams[0]->codec);
                 if (s->streams[0]->info)
                     av_freep(&s->streams[0]->info->duration_error);
                 av_freep(&s->streams[0]->info);
+                if (s->streams[0]->internal)
+                    av_freep(&s->streams[0]->internal->avctx);
+                av_freep(&s->streams[0]->internal);
                 av_freep(&s->streams[0]);
                 s->nb_streams = 0;
                 if (CONFIG_DV_DEMUXER) {



More information about the ffmpeg-cvslog mailing list