mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 10:14:13 -05:00
updater: Check return values in ClearShaderCache
Invoking filesystem::remove_all on potentially truncated paths seems like a bad idea.
This commit is contained in:
committed by
Ryan Foster
parent
9185489586
commit
6340d7a845
@@ -1235,9 +1235,11 @@ static void UpdateRegistryVersion(const Manifest &manifest)
|
||||
static void ClearShaderCache()
|
||||
{
|
||||
wchar_t shader_path[MAX_PATH];
|
||||
SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, shader_path);
|
||||
StringCbCatW(shader_path, sizeof(shader_path), L"\\obs-studio\\shader-cache");
|
||||
filesystem::remove_all(shader_path);
|
||||
if (SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, shader_path) == S_OK) {
|
||||
if (SUCCEEDED(StringCbCatW(shader_path, sizeof(shader_path), L"\\obs-studio\\shader-cache"))) {
|
||||
filesystem::remove_all(shader_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void UpdateHookFiles(void);
|
||||
|
||||
Reference in New Issue
Block a user