You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: libobs/frontend: Settings crashes on a NULL output id when the stream protocol has no output (upstream #12843) #217
Upstream OBS bug, reported by HanabishiRecca in obsproject/obs-studio#12843 (their issue includes a NULL guard for find_output). Code unchanged in this fork.
Location
libobs/obs-output.c:122-130: find_output() runs strcmp on the id with no NULL check. Every id-keyed getter reaches it (obs_get_output_flags, obs_output_get_display_name, obs_output_defaults, obs_get_output_properties, obs_get_output_supported_video_codecs, obs_get_output_supported_audio_codecs).
frontend/settings/OBSBasicSettings_Stream.cpp:1545, 1580, 1749, 1757: const char *output; is declared uninitialised, then filled by obs_enum_output_types_with_protocol(), whose callback never runs when no output supports the protocol. The pointer is then passed to the codec getters above.
Class
Uninitialised pointer / NULL dereference (crash).
How it is reached
Opening Settings when the stream service's protocol has no output (the reporter's case: no outputs available). Reproduced headlessly with a profile whose stream protocol has no registered output: SIGSEGV in find_output (id=0x0) ← obs_get_output_supported_audio_codecs ← OBSBasicSettings::ResetEncoders ← LoadOutputSettings ← the OBSBasicSettings constructor, the same stack as the report.
Proposed fix and failing test
Fix: find_output() returns NULL for a NULL id (as the getters already handle unknown ids), and the four frontend pointers start as nullptr. Both are needed: the frontend change alone still passes NULL into libobs, and the libobs guard alone leaves undefined behaviour in the frontend.
RED test (cmocka, test_output_null_id): each of the six getters called with NULL in a forked child crashes with signal 11 today (6 of 7 fail; a registered-id control passes). With the fix all 7 pass, and the headless repro opens Settings without crashing.
@HanabishiRecca you reported this in obsproject/obs-studio#12843, so a heads-up: it's fixed here in obs-rust by #219, with a regression test. The libobs half is the NULL guard in find_output() you suggested.
Cause: the stream settings page declares const char *output; uninitialised and fills it from obs_enum_output_types_with_protocol(). When no output supports the protocol, the callback never runs and the garbage/NULL pointer reaches find_output()'s strcmp. Besides your guard, the four frontend pointers now start as nullptr, so the frontend no longer passes undefined values into libobs. A headless repro with a stream protocol that has no registered output crashed with your stack before and opens Settings after.
Workaround on stock OBS: make sure the output plugin for your stream protocol (obs-outputs for RTMP) loads, so Settings has an output to find.
obs-rust is an AI-assisted fork of OBS; on Arch it's obs-studio-rust-git in the AUR.
If you get a chance to try it, a reply here on whether Settings opens in your setup would really help.
Activity
rdoupe commentedon Oct 11, 2026
Claiming: this issue.
test_output_null_id(6 of 7 crash today).find_output()and initialise the four frontend output pointers.PR within the hour.
libobs, frontend: Don't crash on a NULL output id in Settings
test: Pin output getters crashing on a NULL id
libobs, frontend: Don't crash on a NULL output id in Settings
rdoupe commentedon Oct 11, 2026
@HanabishiRecca you reported this in obsproject/obs-studio#12843, so a heads-up: it's fixed here in obs-rust by #219, with a regression test. The libobs half is the NULL guard in
find_output()you suggested.Cause: the stream settings page declares
const char *output;uninitialised and fills it fromobs_enum_output_types_with_protocol(). When no output supports the protocol, the callback never runs and the garbage/NULL pointer reachesfind_output()'sstrcmp. Besides your guard, the four frontend pointers now start asnullptr, so the frontend no longer passes undefined values into libobs. A headless repro with a stream protocol that has no registered output crashed with your stack before and opens Settings after.Workaround on stock OBS: make sure the output plugin for your stream protocol (
obs-outputsfor RTMP) loads, so Settings has an output to find.obs-rust is an AI-assisted fork of OBS; on Arch it's
obs-studio-rust-gitin the AUR.If you get a chance to try it, a reply here on whether Settings opens in your setup would really help.