Repository navigation
utils: Report list items without a name or value as empty strings - #18
Merged
Merged
Conversation
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 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
zackees
reviewed
Oct 20, 2026
zackees
left a comment
Member
There was a problem hiding this comment.
Coordinator review. The change itself is correct and minimal: a NULL list-item name or string value becomes "" instead of throwing std::logic_error out of nlohmann::json, and the int/float paths are untouched.
Policy flag for @zackees: obs-studio's AGENTS.md ("OBS WebSocket compatibility directive") keeps the C++ plugin as an unmodified compatibility check, and says not to modify it to accommodate Rust OBS. This fixes a crash that also happens upstream with C libobs, so it is not an accommodation, but it is still a change to the plugin and needs the maintainer's explicit OK before merging.
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 23, 2026
…bs-rust#1996) * plugins/obs-websocket: bump to notify the parallel batch waiter under the lock Bumps the submodule from 0d663eefb to 99dd8468b, which brings in: - obs-rust/obs-websocket#18: list items without a name or value report empty strings (obs-rust#1266) - obs-rust/obs-websocket#19: GetStats CPU usage is measured per session - 99dd8468b: a parallel RequestBatch notifies its waiter while holding the lock, so the waiter cannot return and free the shared batch state while the last task is still notifying (the intermittent test_ws_batch_order SIGSEGV on macOS Tier 2). * docs: record the parallel RequestBatch crash fix in the features ledger
4 of 7 tasks
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 24, 2026
…ust#2251) obs-websocket's GetInputPropertiesListPropertyItems turns every item of a list property into json. Utils::Obs::ArrayHelper::GetListPropertyItems used to put the const char * from obs_property_list_item_name() and obs_property_list_item_string() straight into the json value, and a NULL pointer throws std::logic_error ("basic_string: construction from null is not valid") on the websocket thread, so OBS aborted. libobs keeps such items as they were added: the macOS Screen Capture source puts a placeholder with a NULL value at the top of its display and application lists (upstream obsproject/obs-studio#13905). The fork fix, obs-rust/obs-websocket#18 (a port of obsproject/obs-websocket#1355), reports those items with empty strings and came in with the submodule bump in obs-rust#1996. test_ws_list_property_items compiles the plugin's ArrayHelper against libobs and builds list properties with a NULL value and a NULL name. It needs no libobs startup and no display. With the submodule at 0d663ee, the commit before the fix, both NULL cases fail (the helper throws); at the current pin all 3 cases pass. The fix gets its line in docs/features.md. Fixes obs-rust#1266
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetInputPropertiesListPropertyItemsput the name and string value of every list item straight into json (Utils::Obs::ArrayHelper::GetListPropertyItems(),src/utils/Obs_ArrayHelper.cpplines 270 and 277). libobs keeps items as they were added, so an item with a NULL name or NULL string value made json throwstd::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