mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02:00
UI: Fix null pointer dereference
strcmp(obs_get_encoder_codec(option), "opus") causes the application to segfault while loading service if find_encoder(id) returns NULL. Add a null pointer check to prevent that from occurring.
This commit is contained in:
parent
10c82e638c
commit
7d25a80610
@ -1431,7 +1431,9 @@ bool OBSBasic::LoadService()
|
||||
|
||||
option = config_get_string(basicConfig, "AdvOut",
|
||||
"AudioEncoder");
|
||||
if (strcmp(obs_get_encoder_codec(option), "opus") != 0)
|
||||
|
||||
const char *encoder_codec = obs_get_encoder_codec(option);
|
||||
if (!encoder_codec || strcmp(encoder_codec, "opus") != 0)
|
||||
config_set_string(basicConfig, "AdvOut", "AudioEncoder",
|
||||
"ffmpeg_opus");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user