Skip to content

utils: Report list items without a name or value as empty strings - #18

Open
rdoupe wants to merge 1 commit into
obs-rust:masterfrom
rdoupe:fix/list-item-null
Open

rdoupe wants to merge 1 commit into
obs-rust:masterfrom
rdoupe:fix/list-item-null

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

GetInputPropertiesListPropertyItems put the name and string value of every list item straight into json (Utils::Obs::ArrayHelper::GetListPropertyItems(), src/utils/Obs_ArrayHelper.cpp lines 270 and 277). libobs keeps items as they were added, so an item with a NULL name or NULL string value made json throw std::logic_error ("basic_string: construction from null is not valid") on the websocket thread, and OBS aborted. The macOS Screen Capture source adds a placeholder with a NULL value at the top of its display and application lists, so the request crashed OBS every time for those properties (upstream obsproject/obs-studio#13905, reported by sgaldeano).

A NULL name or value is now reported as an empty string, which is also what the properties dialog stores when such an entry is picked. Items with a name and value are reported as before.

Port of obsproject/obs-websocket#1355 by xiaoshao9704 (co-author on the commit).

Tested in obs-rust/obs-studio with test_ws_list_property_items, which compiles this ArrayHelper against libobs: 2 of 3 cases fail at 0d663ee (an item with a NULL value, an item with a NULL name) and 3 of 3 pass with the fix, in both libobs lanes. Also in a full OBS build (frontend + obs-websocket) in both lanes, and end to end: with an input that has such items, the release v0.1.0-beta.20261014 and current master abort on the request; builds with this branch answer with empty strings.

Refs obs-rust/obs-studio#1266. The obs-rust/obs-studio PR that moves the submodule to this branch carries the regression test and closes the issue.

🤖 Generated with Claude Code

GetInputPropertiesListPropertyItems put the name and string value of
every list item straight into json. libobs keeps items as they were
added, so an item with a NULL name or NULL string value made json throw
std::logic_error ("basic_string: construction from null is not valid")
on the websocket thread, and OBS aborted. The macOS Screen Capture
source adds a placeholder with a NULL value at the top of its display
and application lists, so the request crashed OBS every time for those
properties (upstream obsproject/obs-studio#13905, reported by
sgaldeano).

A NULL name or value is now reported as an empty string, which is also
what the properties dialog stores when such an entry is picked. Items
with a name and value are reported as before.

Port of obsproject/obs-websocket#1355 by xiaoshao9704.

Refs obs-rust/obs-studio#1266.

Co-Authored-By: XiaoShao <26596822+xiaoshao9704@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant