mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +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/7334>
This commit is contained in:
parent
b8d7cdbd1f
commit
c4af350105
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