Skip to content

bug: libobs: an out-of-range transition scale type gives an uninitialized scale #2064

Closed

Description

@rdoupe

Bug

recalculate_transition_matrix() (libobs/obs-source-transition.c.h) reads an uninitialized scale when transition_scale_type is outside the obs_transition_scale_type enum. obs_transition_load() takes that value from a scene collection without checking it, so a scene collection with a bad scale type puts a garbage float into the transition's render matrix. GCC also warns about it (-Wmaybe-uninitialized).

There's no memory-safety impact: it's a wrong scale, with no pointer or index involved. Found while porting the transition clock and fit (#2040/#2055). Upstream has the same code.

Plan

  1. RED: a test that loads a transition with an out-of-range scale type from obs_data, and one that sets it through obs_transition_set_scale_type(). Both must give a defined matrix.
  2. GREEN: treat an out-of-range scale type as the default (OBS_TRANSITION_SCALE_MAX_ONLY), on load and in the setter. Initialize the scale in recalculate_transition_matrix() as a backstop. Keep the C and the Rust port from obs-source: Port the transition clock and fit #2055 identical, if obs-source: Port the transition clock and fit #2055 has merged by then.

Activity

  1. rdoupe commented on Oct 24, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2064.

  2. added
    claimed
    on Oct 24, 2026
  3. added 3 commits that reference this issue on Oct 24, 2026
    bd202bf
    c48af37
    316255e
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