mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
gstvalue: fix crash in transform allocation params to string
when gst_buffer_pool_config_set_allocator (config, alloc, NULL); gst_structure_to_string or GST_DEBUG (pool, "config %" GST_PTR_FORMAT, config) will crash. this patch fix that Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7943>
This commit is contained in:
parent
818f64a641
commit
66e21d1e70
1 changed files with 13 additions and 8 deletions
|
@ -8077,7 +8077,9 @@ gst_value_transform_allocation_params_string (const GValue * value1,
|
||||||
{
|
{
|
||||||
GstAllocationParams *params = value1->data[0].v_pointer;
|
GstAllocationParams *params = value1->data[0].v_pointer;
|
||||||
gchar *res;
|
gchar *res;
|
||||||
GstStructure *s;
|
|
||||||
|
if (params) {
|
||||||
|
GstStructure *s = NULL;
|
||||||
|
|
||||||
s = gst_structure_new_static_str ("GstAllocationParams",
|
s = gst_structure_new_static_str ("GstAllocationParams",
|
||||||
"flags", GST_TYPE_MEMORY_FLAGS, params->flags,
|
"flags", GST_TYPE_MEMORY_FLAGS, params->flags,
|
||||||
|
@ -8087,6 +8089,9 @@ gst_value_transform_allocation_params_string (const GValue * value1,
|
||||||
|
|
||||||
res = gst_structure_to_string (s);
|
res = gst_structure_to_string (s);
|
||||||
gst_structure_free (s);
|
gst_structure_free (s);
|
||||||
|
} else {
|
||||||
|
res = g_strdup ("NULL");
|
||||||
|
}
|
||||||
|
|
||||||
dest_value->data[0].v_pointer = res;
|
dest_value->data[0].v_pointer = res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue