From ad7f7c87f0e86d3e0e2eeb45e9170111b40d4825 Mon Sep 17 00:00:00 2001 From: Nicholas Jackson Date: Tue, 19 Jan 2021 13:19:31 -0800 Subject: avmux: fix segfault when a plugin's long_name is NULL Some plugins register an empty long_name field. Check for this before calling strcmp to avoid a crash. Part-of: --- ext/libav/gstavmux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/libav/gstavmux.c b/ext/libav/gstavmux.c index 325a79d..32c1832 100644 --- a/ext/libav/gstavmux.c +++ b/ext/libav/gstavmux.c @@ -921,9 +921,11 @@ gst_ffmpegmux_register (GstPlugin * plugin) continue; } - if ((!strncmp (in_plugin->long_name, "raw ", 4))) { - GST_LOG ("Ignoring raw muxer %s", in_plugin->name); - continue; + if (in_plugin->long_name != NULL) { + if ((!strncmp (in_plugin->long_name, "raw ", 4))) { + GST_LOG ("Ignoring raw muxer %s", in_plugin->name); + continue; + } } if (gst_ffmpegmux_get_replacement (in_plugin->name)) -- cgit v1.2.1