mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-06 01:19:38 +00:00
registry: check the value of dladdr()
info.dli_fname could be NULL. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/994 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1659>
This commit is contained in:
parent
69eeb854ea
commit
81a0e92d9b
1 changed files with 10 additions and 0 deletions
|
@ -1573,9 +1573,19 @@ priv_gst_get_relocated_libgstreamer (void)
|
||||||
{
|
{
|
||||||
Dl_info info;
|
Dl_info info;
|
||||||
|
|
||||||
|
GST_DEBUG ("attempting to retrieve libgstreamer-1.0 location using "
|
||||||
|
"dladdr()");
|
||||||
|
|
||||||
if (dladdr (&gst_init, &info)) {
|
if (dladdr (&gst_init, &info)) {
|
||||||
|
GST_LOG ("dli_fname: %s", info.dli_fname);
|
||||||
|
|
||||||
|
if (!info.dli_fname) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
dir = g_path_get_dirname (info.dli_fname);
|
dir = g_path_get_dirname (info.dli_fname);
|
||||||
} else {
|
} else {
|
||||||
|
GST_LOG ("dladdr() failed");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue