UI: Fix themeDir buffer being resized incorrectly

c677bac875 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.
This commit is contained in:
derrod
2024-06-12 22:03:23 +02:00
committed by Ryan Foster
parent e454f488aa
commit 4a46d2d722

View File

@@ -417,7 +417,6 @@ static vector<OBSThemeVariable> 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,