mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 13:11:06 +00:00
validate: Copy action structure before retrieving strings from it
The returned strings are only valid for as long as the structure is valid. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7333>
This commit is contained in:
parent
604cc0901c
commit
417c5e19b7
1 changed files with 3 additions and 1 deletions
|
@ -2903,6 +2903,7 @@ _fill_action (GstValidateScenario * scenario, GstValidateAction * action,
|
|||
GstValidateExecuteActionReturn res = GST_VALIDATE_EXECUTE_ACTION_NONE;
|
||||
gboolean optional, needs_parsing = FALSE;
|
||||
|
||||
structure = gst_structure_copy (structure);
|
||||
action->type = gst_structure_get_name (structure);
|
||||
action_type = _find_action_type (action->type);
|
||||
|
||||
|
@ -2910,6 +2911,7 @@ _fill_action (GstValidateScenario * scenario, GstValidateAction * action,
|
|||
GST_ERROR_OBJECT (scenario, "Action type %s no found",
|
||||
gst_structure_get_name (structure));
|
||||
|
||||
gst_structure_free (structure);
|
||||
return GST_VALIDATE_EXECUTE_ACTION_ERROR;
|
||||
}
|
||||
|
||||
|
@ -2935,7 +2937,7 @@ _fill_action (GstValidateScenario * scenario, GstValidateAction * action,
|
|||
"No timeout time for action %" GST_PTR_FORMAT, structure);
|
||||
}
|
||||
|
||||
action->structure = gst_structure_copy (structure);
|
||||
action->structure = structure;
|
||||
|
||||
if (!(action->name = gst_structure_get_string (action->structure, "name")))
|
||||
action->name = "";
|
||||
|
|
Loading…
Reference in a new issue