mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08: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:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user