aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2017-07-16 12:43:09 +0200
committerAnton Khirnov <anton@khirnov.net>2017-07-22 09:30:56 +0200
commit2b1324bd167553f49736e4eaa94f96da9982925e (patch)
treeda52ac6c85f4076814fa81b318c8eef6075088a2
parent9b9285bbf18e3bca87ec4969f661a4b321756cd5 (diff)
downloadffmpeg-2b1324bd167553f49736e4eaa94f96da9982925e.tar.gz
lavf: allow avformat_close_input() with NULL
This is consistent with how other destructors behave. Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavformat/utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index eaba473914..bbdc2cdb8a 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2733,7 +2733,12 @@ void avformat_free_context(AVFormatContext *s)
void avformat_close_input(AVFormatContext **ps)
{
AVFormatContext *s = *ps;
- AVIOContext *pb = s->pb;
+ AVIOContext *pb;
+
+ if (!*ps)
+ return;
+
+ pb = s->pb;
if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
(s->flags & AVFMT_FLAG_CUSTOM_IO))