[libav-stable] avformat: Make avformat_free_context handle NULL

Luca Barbato git at libav.org
Fri Oct 17 11:04:12 CEST 2014


Module: libav
Branch: master
Commit: 0db6bbb24c1a9f6b5527f460361a5a4132248eee

Author:    Luca Barbato <lu_zero at gentoo.org>
Committer: Vittorio Giovara <vittorio.giovara at gmail.com>
Date:      Wed Oct 15 02:35:55 2014 +0200

avformat: Make avformat_free_context handle NULL

Work as the other free()-like functions.

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

---

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

diff --git a/libavformat/utils.c b/libavformat/utils.c
index ef2d89f..3ea0ebd 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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);



More information about the libav-stable mailing list