harfbuzz: security bump to version 1.4.4
[buildroot-gz.git] / package / libvdpau / 0003-vdpau-module-searchpath.patch
blobbd835153d0581a2b42494d532c04267ba76308d9
1 From: Andreas Beckmann <debian@abeckmann.de>
2 Subject: search the vdpau module in multiple directories
3 start searching the vdpau module in ${ORIGIN}/vdpau, then the MODULEDIR and
4 finally fall back to /usr/lib/vdpau
6 [Patch taken from
7 https://anonscm.debian.org/cgit/pkg-nvidia/libvdpau.git/tree/debian/patches/vdpau-module-searchpath.patch.]
9 Signed-off-by: Damien Lanson <damien@kal-host.com>
11 --- a/src/vdpau_wrapper.c
12 +++ b/src/vdpau_wrapper.c
13 @@ -103,6 +103,13 @@ static char * _vdp_get_driver_name_from_
14 return driver_name;
17 +static char const * _vdpau_module_search_paths[] = {
18 + "${ORIGIN}/vdpau",
19 + VDPAU_MODULEDIR,
20 + "/usr/lib/vdpau",
21 + NULL
22 +};
24 static VdpStatus _vdp_open_driver(
25 Display * display,
26 int screen)
27 @@ -117,6 +127,7 @@ static VdpStatus _vdp_open_driver(
28 char vdpau_driver_lib[PATH_MAX];
29 char const * vdpau_trace;
30 char const * func_name;
31 + char const ** module_path;
33 vdpau_driver = secure_getenv("VDPAU_DRIVER");
34 if (vdpau_driver) {
35 @@ -138,9 +146,11 @@ static VdpStatus _vdp_open_driver(
37 /* Fallback to VDPAU_MODULEDIR when VDPAU_DRIVER_PATH is not set,
38 * or if we fail to create the driver path/dlopen the library. */
39 - if (!_vdp_driver_dll) {
40 + for (module_path = _vdpau_module_search_paths;
41 + !_vdp_driver_dll && *module_path;
42 + ++module_path) {
43 if (snprintf(vdpau_driver_lib, sizeof(vdpau_driver_lib),
44 - DRIVER_LIB_FORMAT, VDPAU_MODULEDIR, vdpau_driver) >=
45 + DRIVER_LIB_FORMAT, *module_path, vdpau_driver) >=
46 sizeof(vdpau_driver_lib)) {
47 fprintf(stderr, "Failed to construct driver path: path too long\n");