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: obs_transition_load leaks the source already in slot A #2582
Logic error: reference leak, and an active-child count that is never taken back.
How it is reached
obs_transition_load() writes the loaded source into slot A without taking what was there. If the transition already holds a source in slot A, that source's reference is lost, so it is never destroyed. If the slot was active, the source also stays counted as an active child of the transition: it stays active (and showing, while the transition is shown) after the transition moved on.
obs_load_sources() creates every source first, then loads each transition and calls the callback for each source in order. So a source set into a transition before that transition is loaded (by the obs_load_sources() callback for an earlier source, or by a plugin's create) is dropped this way. obs_transition_clear() and obs_transition_set() both take the old source back; the load should too.
No upstream issue; upstream obs-studio has the same code.
Proposed fix and failing test
Fix: take the old slot-A source and its active flag under the transition lock, as obs_transition_clear() does; after unlocking, remove it from the active children if the slot was active, then release it.
Test (RED): a cmocka test (Linux, core video, like the other transition tests) that loads a transition with obs_load_sources() while slot A already holds a leaf source shown through output channel 0, then checks that the leaf is no longer active or showing and that releasing the test's own reference destroys it. Controls: a load onto an empty slot, and a load of the same source that is already in the slot.
RED: a cmocka test (Linux, core video) that loads a transition through obs_load_sources() while slot A already holds a shown leaf, and checks the leaf is deactivated, hidden and destroyed once released; controls for an empty slot and for reloading the same source.
GREEN: obs_transition_load() takes the old slot-A source and its active flag under the lock and, after unlocking, removes it from the active children (if active) and releases it, as obs_transition_clear() does.
features.md line.
Draft PR with the RED commit today, GREEN shortly after.
Fixed by PR #2584 (merged through the merge queue): obs_transition_load() now takes the old slot-A source and its active flag under the transition lock and, after unlocking, removes it from the active children if the slot was active and releases it, as obs_transition_clear() does. The new test_transition_load_release (graphics suite) covers the shown, hidden and same-source cases plus an empty-slot control.
Nothing is left from this issue, so there is no follow-up issue. No upstream issue exists; upstream obs-studio has the same code.
Activity
rdoupe commentedon Oct 27, 2026
Claiming: #2582.
obs_load_sources()while slot A already holds a shown leaf, and checks the leaf is deactivated, hidden and destroyed once released; controls for an empty slot and for reloading the same source.obs_transition_load()takes the old slot-A source and its active flag under the lock and, after unlocking, removes it from the active children (if active) and releases it, asobs_transition_clear()does.Draft PR with the RED commit today, GREEN shortly after.
test: Check obs_transition_load drops slot A
libobs: Release slot A in obs_transition_load
rdoupe commentedon Oct 27, 2026
Fixed by PR #2584 (merged through the merge queue):
obs_transition_load()now takes the old slot-A source and its active flag under the transition lock and, after unlocking, removes it from the active children if the slot was active and releases it, asobs_transition_clear()does. The newtest_transition_load_release(graphics suite) covers the shown, hidden and same-source cases plus an empty-slot control.Nothing is left from this issue, so there is no follow-up issue. No upstream issue exists; upstream obs-studio has the same code.
libobs: Release slot A in obs_transition_load (obs-rust#2584)