validate: Don't create scenario on a monitor which has no target

Not very probable but avoids a potential NULL pointer dereferencing.

CID 1415460
This commit is contained in:
Thibault Saunier 2017-07-18 10:42:00 -04:00
parent 6572af916b
commit 9ee7b4483c

View file

@ -647,9 +647,13 @@ gst_validate_pipeline_monitor_create_scenarios (GstValidateBinMonitor * monitor)
goto done;
}
}
monitor->scenario =
gst_validate_scenario_factory_create (runner,
GST_ELEMENT_CAST (target), scenario_v[0]);
if (target)
monitor->scenario =
gst_validate_scenario_factory_create (runner,
GST_ELEMENT_CAST (target), scenario_v[0]);
else
GST_INFO_OBJECT (monitor, "Not creating scenario as monitor"
" already does not have a target.");
g_strfreev (scenario_v);
}
}