mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 23:36: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/1644>
This commit is contained in:
parent
c7d5b774d5
commit
a7b9857647
1 changed files with 10 additions and 0 deletions
|
@ -1573,9 +1573,19 @@ priv_gst_get_relocated_libgstreamer (void)
|
|||
{
|
||||
Dl_info info;
|
||||
|
||||
GST_DEBUG ("attempting to retrieve libgstreamer-1.0 location using "
|
||||
"dladdr()");
|
||||
|
||||
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);
|
||||
} else {
|
||||
GST_LOG ("dladdr() failed");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue