From 790e78c4f8b7cc501aff00eab40c2b8b6ae22f23 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 3 May 2017 17:57:05 +0200 Subject: [PATCH] validate-scenario: Avoid invalid memory access The name of the action comes directly (i.e. not copied) from the contained GstStructure field. Therefore make sure to take that name from the proper structure field (copied just before) and not from an outside one. --- validate/gst/validate/gst-validate-scenario.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index b90da91b21..4e41aca029 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -1596,11 +1596,11 @@ _fill_action (GstValidateScenario * scenario, GstValidateAction * action, "No timeout time for action %" GST_PTR_FORMAT, structure); } - if (!(action->name = gst_structure_get_string (structure, "name"))) - action->name = ""; - action->structure = gst_structure_copy (structure); + if (!(action->name = gst_structure_get_string (action->structure, "name"))) + action->name = ""; + if (!action->priv->main_structure) action->priv->main_structure = gst_structure_copy (structure);