fix possible segfault on lavf demuxer patch by (adland <adland123 at yahoo dot com>)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12305 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2004-04-26 19:55:55 +00:00
parent 813b34f68f
commit 057916ee65
1 changed files with 4 additions and 2 deletions

View File

@ -350,9 +350,11 @@ int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg)
void demux_close_lavf(demuxer_t *demuxer)
{
lavf_priv_t* priv = demuxer->priv;
if (priv){
av_close_input_file(priv->avfc); priv->avfc= NULL;
if(priv->avfc)
{
av_close_input_file(priv->avfc); priv->avfc= NULL;
}
free(priv); demuxer->priv= NULL;
}
}