Skip to content

bug: obs_output_set_video_encoder2 tests the argument, not the stored slot #2491

Closed

Description

@rdoupe

Two upstream bugs in obs_output_set_video_encoder2() (libobs/obs-output.c.h), found while porting its slot checks (#2475). Both come from testing the encoder argument where the code should test what was actually stored in the slot:

  1. Caption track for an empty slot. obs_encoder_get_ref(encoder) returns NULL when the encoder is being destroyed, so the slot stays empty, but if (encoder != NULL) still creates a caption track for it.
  2. Spurious NULL warning. Clearing video slot 0 (encoder == NULL) on an output with a preferred size calls obs_encoder_set_scaled_size(NULL, ...), which logs "NULL parameter". obs_output_set_preferred_size2() already checks the slot before the same call.

Fix: test output->video_encoders[idx] (the stored slot) in both places. Both are pinned in test_output_slots_steps as "characterized, not endorsed".

Activity

  1. rdoupe commented on Oct 26, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2491.

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

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions