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: A filter's size query can follow a NULL target during filter restore or removal #2172
A filter can briefly have a parent but no target, and its size query then follows a NULL target.
obs_source_restore_filters() sets each filter's parent one loop iteration before its target, outside filter_mutex.
obs_source_filter_remove_refless() clears the parent and then the target after it drops the lock.
obs_source_get_width()/obs_source_get_height() on a filter take no lock. For a filter that is disabled or has no size callback, get_base_width()/get_base_height() asks its target, and passes the NULL target to the next level.
So a size query racing with a filter restore (undo of a filter removal) or with a removal can crash. Callers include the Filters dialog's preview, scene item size updates and obs-websocket. Upstream has had the same code since 2021 (0fd1238).
Found by reading the code while porting the size routing (#2171); it has not been reproduced.
Plan
RED: a real-libobs test that queries a filter's size while it has a parent but no target. Set up that state deterministically, e.g. from a filter callback during restore, or with a test hook if the window can't be reached otherwise. Explain the method in the test.
GREEN:
get_base_width/get_base_height return 0 when the target is NULL;
obs_source_restore_filters() sets the target before the parent, so no filter is ever seen half-attached;
every attached filter reports the same size as before.
This waits for #2171, which moves the size routing these functions use.
Activity
zackees commentedon Oct 24, 2026
Claiming: this issue. #2171 has merged; following the plan above.
libobs: don't follow a NULL filter target when asking a filter's size (…
test: characterize obs_source_restore_filters (Refs #5801)
test: characterize obs_source_restore_filters (Refs #5801)
test: characterize obs_source_restore_filters (Refs #5801)
test: characterize obs_source_restore_filters (Refs #5801)
obs-source: port obs_source_restore_filters to Rust (Fixes obs-rust#5801