mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +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;
|
GstValidateExecuteActionReturn res = GST_VALIDATE_EXECUTE_ACTION_NONE;
|
||||||
gboolean optional, needs_parsing = FALSE;
|
gboolean optional, needs_parsing = FALSE;
|
||||||
|
|
||||||
|
structure = gst_structure_copy (structure);
|
||||||
action->type = gst_structure_get_name (structure);
|
action->type = gst_structure_get_name (structure);
|
||||||
action_type = _find_action_type (action->type);
|
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_ERROR_OBJECT (scenario, "Action type %s no found",
|
||||||
gst_structure_get_name (structure));
|
gst_structure_get_name (structure));
|
||||||
|
|
||||||
|
gst_structure_free (structure);
|
||||||
return GST_VALIDATE_EXECUTE_ACTION_ERROR;
|
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);
|
"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")))
|
if (!(action->name = gst_structure_get_string (action->structure, "name")))
|
||||||
action->name = "";
|
action->name = "";
|
||||||
|
|
Loading…
Reference in a new issue