From: Thibault Saunier Date: Wed, 26 May 2021 01:00:09 +0000 (-0400) Subject: validate: Handle unknown type in foreach types X-Git-Tag: 1.19.3~491^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=87f656d1f6df4a0246d2959b5dafa577e7e64cc4;p=platform%2Fupstream%2Fgstreamer.git validate: Handle unknown type in foreach types Part-of: --- diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index c84293e..e4e74f7 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -523,6 +523,8 @@ gst_validate_action_new (GstValidateScenario * scenario, { GstValidateAction *action = g_slice_new0 (GstValidateAction); + g_assert (action_type); + gst_validate_action_init (action); action->playback_time = GST_CLOCK_TIME_NONE; action->priv->timeout = GST_CLOCK_TIME_NONE; @@ -3822,9 +3824,13 @@ gst_validate_create_subaction (GstValidateScenario * scenario, GstStructure * nstruct, gint it, gint max) { GstValidateAction *subaction; + GstValidateActionType *action_type = + _find_action_type (gst_structure_get_name (nstruct)); - subaction = gst_validate_action_new (scenario, - _find_action_type (gst_structure_get_name (nstruct)), nstruct, FALSE); + if (!action_type) + gst_validate_error_structure (action, + "Unknown action type: '%s'", gst_structure_get_name (nstruct)); + subaction = gst_validate_action_new (scenario, action_type, nstruct, FALSE); GST_VALIDATE_ACTION_RANGE_NAME (subaction) = GST_VALIDATE_ACTION_RANGE_NAME (action); GST_VALIDATE_ACTION_FILENAME (subaction) =