Repository navigation
utils: Start the scene counter at zero - #5
Merged
Merged
Conversation
GetCanvasSceneCount() counted into an uninitialized size_t, so the result was whatever the stack held plus the number of scenes. RemoveScene uses it to refuse removing the last scene of the main canvas; with a garbage count that check passed, the last scene was removed, and the next GetCurrentProgramScene aborted OBS with std::logic_error (upstream obsproject/obs-studio#10532 and obsproject/obs-studio#10533). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 14, 2026
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.
utils: Start the scene counter at zero
GetCanvasSceneCount()counted scenes into an uninitializedsize_t, so it returned whatever the stack held plus the number of scenes.RemoveScenerefuses to remove the last scene of the main canvas only when that count is below 2. With one scene left the check could pass; the last scene was removed, and the nextGetCurrentProgramSceneaborted OBS withstd::logic_error(upstream obsproject/obs-studio#10532 and obsproject/obs-studio#10533).The counter now starts at zero. Tested in obs-rust/obs-studio with
test_ws_scene_count(5 of 5 fail before, 5 of 5 pass after, both libobs lanes), and end to end over obs-websocket: the lastRemoveScenenow returns 603 "You cannot remove the last scene in the collection." and OBS keeps running.Fixes obs-rust/obs-studio#519. The obs-rust/obs-studio PR that moves the submodule to this commit, opened once this merges, carries the regression test.
🤖 Generated with Claude Code