Skip to content

libobs: obs_source_skip_video_filter crashes when the filter was removed during render #2160

Closed

Description

@rdoupe

Bug

obs_source_skip_video_filter() (libobs/obs-source.c.h) dereferences the filter's parent without checking it:

target = obs_filter_get_target(filter);
parent = obs_filter_get_parent(filter);
parent_flags = parent->info.output_flags;

When a filter is removed from its source, its parent and target are cleared. A filter that calls obs_source_skip_video_filter() from its video_render after that point crashes on a NULL parent. Filters commonly call it when they have nothing to draw: a shader that failed to compile, an effect that is disabled, or a size of 0. The removal can come from the Filters dialog, a script or an obs-websocket RemoveSourceFilter.

obs_source_process_filter_begin() and the other filter helpers already return early when there is no parent or target.

Upstream has the same code. Found while scoping round 7 of the Rust port (R7-1).

Plan

  1. RED: a real-libobs test. A filter is removed from inside its own video_render, then calls obs_source_skip_video_filter(), so the render sees the cleared parent deterministically. Also cover a filter that was never attached.
  2. GREEN: return early when the parent or target is NULL, as the other filter helpers do. Every attached filter draws as before.

Activity

  1. rdoupe commented on Oct 24, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2160.

  2. added
    claimed
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions