From ee23dcf534801931c13f9f534586b56e231d3085 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 20 Oct 2012 19:48:26 +0200 Subject: [PATCH] avformat_free_context: allow NULL as argument Fixes CID703682 Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index be1be00b76..f27104e75a 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);