summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Jackson <nicholas.jackson@zii.aero>2021-01-19 13:19:31 -0800
committerTim-Philipp Müller <tim@centricular.com>2021-04-13 01:45:23 +0100
commitf5a5bc12468f3ee5370b9bfe9a7e39e4e3c44de1 (patch)
tree03a11b9821cae4df2b8d50e246b503b0b145eb63
parent301d188bd847cef3cef3cd6e34bbbc0c7f6ed7c0 (diff)
downloadgst-libav-f5a5bc12468f3ee5370b9bfe9a7e39e4e3c44de1.tar.gz
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/128>
-rw-r--r--ext/libav/gstavmux.c8
1 files 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))