mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-06-11 01:08:29 -04:00
coreaudio-encoder: Avoid using SetDllDirectory, specify full path
This commit is contained in:
committed by
Ryan Foster
parent
3b4872c5c0
commit
76ea10e281
@@ -386,12 +386,10 @@ static bool load_from_shell_path(REFKNOWNFOLDERID rfid, const wchar_t *subpath)
|
||||
}
|
||||
|
||||
wchar_t path[MAX_PATH];
|
||||
_snwprintf(path, MAX_PATH, L"%s\\%s", sh_path, subpath);
|
||||
_snwprintf(path, MAX_PATH, L"%s\\%s\\CoreAudioToolbox.dll", sh_path, subpath);
|
||||
CoTaskMemFree(sh_path);
|
||||
|
||||
SetDllDirectory(path);
|
||||
audio_toolbox = LoadLibraryW(L"CoreAudioToolbox.dll");
|
||||
SetDllDirectory(nullptr);
|
||||
audio_toolbox = LoadLibraryExW(path, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
|
||||
|
||||
return !!audio_toolbox;
|
||||
}
|
||||
@@ -401,7 +399,7 @@ static bool load_lib(void)
|
||||
/* -------------------------------------------- */
|
||||
/* attempt to load from path */
|
||||
|
||||
audio_toolbox = LoadLibraryW(L"CoreAudioToolbox.dll");
|
||||
audio_toolbox = LoadLibraryExW(L"CoreAudioToolbox.dll", NULL, LOAD_LIBRARY_SAFE_CURRENT_DIRS);
|
||||
if (!!audio_toolbox)
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user