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
libobs: Canvases accept the internal REMOVED flag and unknown bits; leak when context init fails #2141
There are two small bugs in canvas creation and load (libobs/obs-canvas.c.h).
1. Internal and unknown flag bits are accepted from callers and scene collections
obs_load_canvas() reads "flags" from the scene collection, and obs_canvas_create()/obs_canvas_create_private() take flags from the caller. All three clear only MAIN. So:
The internal REMOVED bit (1 << 31) is accepted. The canvas then reports obs_canvas_removed() from the start, and obs_canvas_remove() returns early, so it is never properly removed.
Unknown bits are stored, and they are saved back on the next save.
Only ACTIVATE, MIX_AUDIO, SCENE_REF and EPHEMERAL are public (enum obs_canvas_flags, without MAIN).
2. A canvas leaks when its context fails to initialize
obs_canvas_create_internal() returns NULL without freeing the canvas when obs_context_data_init() fails. The two later failure paths free it.
Neither bug is reachable through the frontend, which writes only valid flags. A plugin, a script or an edited scene collection can trigger them. Upstream has the same code. Found while scoping round 6 of the Rust port (R6-4).
Plan
RED: real-libobs tests.
Load a canvas whose saved flags include REMOVED and unknown bits. Check obs_canvas_get_flags(), obs_canvas_removed(), that obs_canvas_remove() works, and the saved flags.
Make the same checks through obs_canvas_create() and obs_canvas_create_private().
Every valid flag combination is unchanged.
If a context init failure can be forced, run the leak path under ASan.
GREEN:
Keep only the public flags in obs_canvas_create(), obs_canvas_create_private() and obs_load_canvas(). The main canvas keeps MAIN.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2141.
libobs: Keep only the public canvas flags, and free a canvas whose co…