avformat/avidec: Fix memleak with dv in avi
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 25 Sep 2016 09:56:11 +0000 (11:56 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 25 Sep 2016 17:06:51 +0000 (19:06 +0200)
Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/avidec.c

index 858011c..26b0234 100644 (file)
@@ -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) {