linux-capture: Don't initialize format info if init_obs_pipewire fails

The pointer has been freed by this point so it just segfaults.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2022-04-07 00:26:56 +00:00 committed by Georges Basile Stavracas Neto
parent 9409ce1ea7
commit 9903d73f36

View File

@ -1434,8 +1434,10 @@ void *obs_pipewire_create(enum obs_pw_capture_type capture_type,
obs_pw->restore_token =
bstrdup(obs_data_get_string(settings, "RestoreToken"));
if (!init_obs_pipewire(obs_pw))
if (!init_obs_pipewire(obs_pw)) {
g_clear_pointer(&obs_pw, bfree);
return NULL;
}
init_format_info(obs_pw);