[FFmpeg-cvslog] avformat_free_context: allow NULL as argument

Michael Niedermayer git at videolan.org
Sat Oct 20 20:27:56 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 20 19:48:26 2012 +0200| [ee23dcf534801931c13f9f534586b56e231d3085] | committer: Michael Niedermayer

avformat_free_context: allow NULL as argument

Fixes CID703682
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavformat/utils.c b/libavformat/utils.c
index be1be00..f27104e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3018,6 +3018,9 @@ void avformat_free_context(AVFormatContext *s)
 {
     int i;
 
+    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