[FFmpeg-cvslog] avformat: Make avformat_free_context handle NULL

Luca Barbato git at videolan.org
Sun Jan 18 00:46:53 CET 2015


ffmpeg | branch: release/2.4 | Luca Barbato <lu_zero at gentoo.org> | Wed Oct 15 02:35:55 2014 +0200| [bb823e26b1cbb91b475c10772cdfd867d4809a65] | committer: Vittorio Giovara

avformat: Make avformat_free_context handle NULL

Work as the other free()-like functions.

Bug-Id: CID 1087081
CC: libav-stable at libav.org

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

 libavformat/utils.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 73e3039..94431e1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2447,6 +2447,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);



More information about the ffmpeg-cvslog mailing list