libvisual: use gst_element_class_set_metadata when passing dynamic strings

gst_element_class_set_metadata is meant to only be used with
static or inlined strings, which isn't the case for this element
resulting in use-after-free later on.

https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c#gst_element_class_set_static_metadata

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/698>
This commit is contained in:
Jordan Petridis 2020-06-11 20:57:58 +03:00
parent 30509252ca
commit 1b567af051

View file

@ -106,7 +106,7 @@ gst_visual_class_init (gpointer g_class, gpointer class_data)
gst_element_class_add_static_pad_template (element_class, &src_template);
gst_element_class_add_static_pad_template (element_class, &sink_template);
gst_element_class_set_static_metadata (element_class,
gst_element_class_set_metadata (element_class,
longname, "Visualization",
klass->plugin->info->about, "Benjamin Otte <otte@gnome.org>");