From d19fde7e35eb55fd0cb192452a436eab47c9bb3a Mon Sep 17 00:00:00 2001 From: Richard Boulton Date: Fri, 9 Mar 2001 12:31:07 +0000 Subject: [PATCH] Fix gst_init() so that it doesn't fail when passed two NULLs as parameters. Original commit message from CVS: Fix gst_init() so that it doesn't fail when passed two NULLs as parameters. Was dereferencing the argv pointer to get progname: now defaults to "gstprog". --- gst/gst.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst/gst.c b/gst/gst.c index d46aeba..15ab7fb 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -63,8 +63,6 @@ gst_init (int *argc, char **argv[]) if (!g_thread_supported ()) g_thread_init (NULL); - _gst_progname = g_strdup(*argv[0]); - gtk_init (argc,argv); if (!gst_init_check (argc,argv)) { @@ -123,9 +121,13 @@ gst_init_check (int *argc, gboolean ret = TRUE; gboolean showhelp = FALSE; + _gst_progname = NULL; + if (argc && argv) { gint i, j, k; + _gst_progname = g_strdup(*argv[0]); + for (i=1; i< *argc; i++) { if (!strncmp ("--gst-info-mask=", (*argv)[i], 16)) { guint32 val; @@ -184,6 +186,10 @@ gst_init_check (int *argc, } } + if (_gst_progname == NULL) { + _gst_progname = g_strdup("gstprog"); + } + /* check for ENV variables */ { -- 2.7.4