mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
init: Fix initialisation crash
Fix a case where initialisation fails without setting the passed-in GError and the caller assumes it will be set, and add a guard to catch the condition in case it happens again in the future. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/217>
This commit is contained in:
parent
e267d06344
commit
180c23108b
2 changed files with 9 additions and 2 deletions
|
@ -120,6 +120,9 @@ ges_init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
|
||||||
_init_formatter_assets ();
|
_init_formatter_assets ();
|
||||||
if (!_ges_uri_asset_ensure_setup (uriasset_klass)) {
|
if (!_ges_uri_asset_ensure_setup (uriasset_klass)) {
|
||||||
GST_ERROR ("cannot setup uri asset");
|
GST_ERROR ("cannot setup uri asset");
|
||||||
|
if (error)
|
||||||
|
*error = g_error_new (GST_CORE_ERROR, GST_CORE_ERROR_MISSING_PLUGIN,
|
||||||
|
"Cannot initialize URI asset class.");
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1051,9 +1051,13 @@ _local_command_line (GApplication * application, gchar ** arguments[],
|
||||||
gst_init (&argc, arguments);
|
gst_init (&argc, arguments);
|
||||||
if (!ges_launcher_parse_options (self, arguments, &argc, ctx, &error)) {
|
if (!ges_launcher_parse_options (self, arguments, &argc, ctx, &error)) {
|
||||||
gst_init (NULL, NULL);
|
gst_init (NULL, NULL);
|
||||||
ges_printerr ("Error initializing: %s\n", error->message);
|
|
||||||
g_option_context_free (ctx);
|
g_option_context_free (ctx);
|
||||||
|
if (error) {
|
||||||
|
ges_printerr ("Error initializing: %s\n", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
} else {
|
||||||
|
ges_printerr ("Error parsing command line arguments\n");
|
||||||
|
}
|
||||||
*exit_status = 1;
|
*exit_status = 1;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue