Quoting wm4 (2017-07-16 12:43:09)
> 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)
This is overly lax IMO. *ps being NULL should be allowed, in analogy
with free(NULL) beeing a no-op. But ps being NULL makes no sense at all
ever and just means that the caller is broken, so that should crash.
--
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel