From daa3264d3f81c28c368ce8e791ca4d2d370dc726 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Thu, 13 Jun 2024 22:03:50 -0400 Subject: [PATCH] demux_lavf: fix null derefence in io_open callback The options parameter here can be NULL. It's NULL checked a few lines down, but not for the propagate_opts loop. This results in null derefence with --demuxer-lavf-format=image2. Fixes: b6413f82b22b5c3bd7b0a4fec28fdd2625feaf94 --- demux/demux_lavf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 442f5abcb6..5a35074c1c 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -945,7 +945,7 @@ static int nested_io_open(struct AVFormatContext *s, AVIOContext **pb, struct demuxer *demuxer = s->opaque; lavf_priv_t *priv = demuxer->priv; - if (priv->opts->propagate_opts) { + if (options && priv->opts->propagate_opts) { // Copy av_opts to options, but only entries that are not present in // options. (Hope this will break less by not overwriting important // settings.)