From 4a46d2d7226f5cbf4b28545fbc77aefbb995d22b Mon Sep 17 00:00:00 2001 From: derrod Date: Wed, 12 Jun 2024 22:03:23 +0200 Subject: [PATCH] UI: Fix themeDir buffer being resized incorrectly c677bac875e6b3b6e4d3358aa8b38679ff4fcb1f changed the order here, but this also resulted in the string having whatever size was necessary for the install data path, rather than being large enough to fit a userdata path. To fix this, move the resize operaetion *after* the buit-in themes are searched, and also bump it to 1024 just to be sure. This resulted in a crash due to a bug in os_get_path_internal() which will need to be fixed separately. --- UI/obs-app-theming.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/obs-app-theming.cpp b/UI/obs-app-theming.cpp index 514f1c414..8e79bcc05 100644 --- a/UI/obs-app-theming.cpp +++ b/UI/obs-app-theming.cpp @@ -417,7 +417,6 @@ static vector ParseThemeVariables(const char *themeData) void OBSApp::FindThemes() { string themeDir; - themeDir.resize(512); QStringList filters; filters << "*.obt" // OBS Base Theme @@ -435,6 +434,7 @@ void OBSApp::FindThemes() delete theme; } + themeDir.resize(1024); if (GetConfigPath(themeDir.data(), themeDir.capacity(), "obs-studio/themes/") > 0) { QDirIterator it(QT_UTF8(themeDir.c_str()), filters,