avmux: fix segfault when a plugin's long_name is NULL
authorNicholas Jackson <nicholas.jackson@zii.aero>
Tue, 19 Jan 2021 21:19:31 +0000 (13:19 -0800)
committerNicholas Jackson <nickajacks1@gmail.com>
Tue, 16 Mar 2021 15:44:23 +0000 (15:44 +0000)
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>

ext/libav/gstavmux.c

index 325a79dc01d51eaa88a64abf0b7b03a7a30c2dda..32c1832c142e92ae57991acafd803c8400d4c32b 100644 (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))