Behaves more like FFmpeg, makes some API users not crash on exit. --- libavformat/utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c index eaba473914..24a4335016 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 || !*ps) + return; + + pb = s->pb; if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) || (s->flags & AVFMT_FLAG_CUSTOM_IO)) -- 2.11.0 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel