avformat: Make avformat_free_context handle NULL

Work as the other free()-like functions.

Bug-Id: CID 1087081
CC: libav-stable@libav.org
This commit is contained in:
Luca Barbato 2014-10-15 02:35:55 +02:00 committed by Vittorio Giovara
parent c92965dbfb
commit 0db6bbb24c
1 changed files with 3 additions and 0 deletions

View File

@ -2434,6 +2434,9 @@ void avformat_free_context(AVFormatContext *s)
int i, j;
AVStream *st;
if (!s)
return;
av_opt_free(s);
if (s->iformat && s->iformat->priv_class && s->priv_data)
av_opt_free(s->priv_data);