registry: check the return value of g_win32_get_package_installation_directory_of_module()

g_win32_get_package_installation_directory_of_module() may return NULL
in some circumstances and we need to deal with that.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/996

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1644>
This commit is contained in:
Matthew Waters 2022-02-07 16:33:03 +11:00 committed by GStreamer Marge Bot
parent 2f9ad38118
commit c7d5b774d5

View file

@ -1555,9 +1555,14 @@ priv_gst_get_relocated_libgstreamer (void)
{
char *base_dir;
GST_DEBUG ("attempting to retrieve libgstreamer-1.0 location using "
"Win32-specific method");
base_dir =
g_win32_get_package_installation_directory_of_module
(_priv_gst_dll_handle);
if (!base_dir)
return NULL;
dir = g_build_filename (base_dir, GST_PLUGIN_SUBDIR, NULL);
GST_DEBUG ("using DLL dir %s", dir);