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: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/114>
This commit is contained in:
Nicholas Jackson 2021-01-19 13:19:31 -08:00 committed by Nicholas Jackson
parent 1b81e05ab9
commit ad7f7c87f0

View file

@ -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))