diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 2a6ef97be8..551e906cd4 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -659,8 +659,10 @@ static int avi_read_close(AVFormatContext *s) for(i=0;inb_streams;i++) { AVStream *st = s->streams[i]; AVIStream *ast = st->priv_data; - av_free(ast->index_entries); - av_free(ast); + if(ast){ + av_free(ast->index_entries); + av_free(ast); + } av_free(st->codec.extradata); av_free(st->codec.palctrl); }