gstreamer: Make sure to zero-initialize the GValue before G_VALUE_COLLECT_INIT
G_VALUE_INIT does not zero-initialize the data member as automatic zero-initialization only happens for non-union types. For union types the initialized value is undefined. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4595 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9525>
This commit is contained in:
parent
9d6cd03221
commit
a052257c03
@ -2100,6 +2100,7 @@ ges_timeline_element_set_child_property_valist (GESTimelineElement * self,
|
||||
if (!ges_timeline_element_lookup_child (self, name, NULL, &pspec))
|
||||
goto not_found;
|
||||
|
||||
memset (&value, 0, sizeof (value));
|
||||
G_VALUE_COLLECT_INIT (&value, pspec->value_type, var_args,
|
||||
G_VALUE_NOCOPY_CONTENTS, &error);
|
||||
|
||||
|
@ -1359,6 +1359,7 @@ gst_caps_id_str_set_simple_valist (GstCaps * caps, const GstIdStr * field,
|
||||
|
||||
type = va_arg (varargs, GType);
|
||||
|
||||
memset (&value, 0, sizeof (value));
|
||||
G_VALUE_COLLECT_INIT (&value, type, varargs, 0, &err);
|
||||
if (G_UNLIKELY (err)) {
|
||||
g_critical ("%s", err);
|
||||
@ -1397,6 +1398,7 @@ gst_caps_set_simple_valist (GstCaps * caps, const char *field, va_list varargs)
|
||||
|
||||
type = va_arg (varargs, GType);
|
||||
|
||||
memset (&value, 0, sizeof (value));
|
||||
G_VALUE_COLLECT_INIT (&value, type, varargs, 0, &err);
|
||||
if (G_UNLIKELY (err)) {
|
||||
g_critical ("%s", err);
|
||||
@ -1441,6 +1443,7 @@ gst_caps_set_simple_static_str_valist (GstCaps * caps, const char *field,
|
||||
|
||||
type = va_arg (varargs, GType);
|
||||
|
||||
memset (&value, 0, sizeof (value));
|
||||
G_VALUE_COLLECT_INIT (&value, type, varargs, 0, &err);
|
||||
if (G_UNLIKELY (err)) {
|
||||
g_critical ("%s", err);
|
||||
|
@ -484,6 +484,7 @@ gst_child_proxy_set_valist (GstChildProxy * object,
|
||||
if (!gst_child_proxy_lookup (object, name, &target, &pspec))
|
||||
goto not_found;
|
||||
|
||||
memset (&value, 0, sizeof (value));
|
||||
G_VALUE_COLLECT_INIT (&value, pspec->value_type, var_args,
|
||||
G_VALUE_NOCOPY_CONTENTS, &error);
|
||||
|
||||
|
@ -426,6 +426,7 @@ gst_element_factory_property_valist_to_array (const gchar * first,
|
||||
|
||||
names_array[n_params] = name;
|
||||
|
||||
memset (&values_array[n_params], 0, sizeof (values_array[n_params]));
|
||||
G_VALUE_COLLECT_INIT (&values_array[n_params], pspec->value_type,
|
||||
properties, 0, &error);
|
||||
|
||||
|
@ -1232,6 +1232,8 @@ gst_structure_set_valist_internal (GstStructure * structure,
|
||||
while (fieldname) {
|
||||
GstStructureField field = { GST_ID_STR_INIT, G_VALUE_INIT };
|
||||
|
||||
memset (&field.value, 0, sizeof (field.value));
|
||||
|
||||
if (static_string)
|
||||
gst_id_str_set_static_str (&field.name, fieldname);
|
||||
else
|
||||
@ -1356,6 +1358,8 @@ gst_structure_id_set_valist_internal (GstStructure * structure,
|
||||
while (fieldname) {
|
||||
GstStructureField field = { GST_ID_STR_INIT, G_VALUE_INIT };
|
||||
|
||||
memset (&field.value, 0, sizeof (field.value));
|
||||
|
||||
gst_id_str_set_static_str (&field.name, g_quark_to_string (fieldname));
|
||||
type = va_arg (varargs, GType);
|
||||
|
||||
@ -1428,6 +1432,8 @@ gst_structure_id_str_set_valist_internal (GstStructure * structure,
|
||||
while (fieldname) {
|
||||
GstStructureField field = { GST_ID_STR_INIT, G_VALUE_INIT };
|
||||
|
||||
memset (&field.value, 0, sizeof (field.value));
|
||||
|
||||
gst_id_str_copy_into (&field.name, fieldname);
|
||||
type = va_arg (varargs, GType);
|
||||
|
||||
|
@ -1297,6 +1297,7 @@ gst_tag_list_add_valist (GstTagList * list, GstTagMergeMode mode,
|
||||
g_warning ("unknown tag '%s'", tag);
|
||||
return;
|
||||
}
|
||||
memset (&value, 0, sizeof (value));
|
||||
G_VALUE_COLLECT_INIT (&value, info->type, var_args, 0, &error);
|
||||
if (error) {
|
||||
g_warning ("%s: %s", G_STRLOC, error);
|
||||
|
@ -211,6 +211,7 @@ gst_tracer_record_new (const gchar * name, const gchar * firstfield, ...)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset (&val, 0, sizeof (val));
|
||||
G_VALUE_COLLECT_INIT (&val, type, varargs, G_VALUE_NOCOPY_CONTENTS, &err);
|
||||
if (G_UNLIKELY (err)) {
|
||||
g_critical ("%s", err);
|
||||
|
Loading…
x
Reference in New Issue
Block a user