mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
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".
This commit is contained in:
parent
1f3f906886
commit
d19fde7e35
1 changed files with 8 additions and 2 deletions
10
gst/gst.c
10
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 */
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue