registry: check the return value of g_win32_get_package_installation_directory_of_mod...
authorMatthew Waters <matthew@centricular.com>
Mon, 7 Feb 2022 05:33:03 +0000 (16:33 +1100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 7 Feb 2022 09:37:57 +0000 (09:37 +0000)
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>

subprojects/gstreamer/gst/gstregistry.c

index 1c5bc32..21ccb74 100644 (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);