Skip to content

bug: libobs: a scene item bounds type outside the enum is kept and draws as an unknown box #2281

Closed

Description

@rdoupe

Found while planning the Rust port of the scene item transform.

Bug

A scene item's bounds type outside OBS_BOUNDS_NONE..OBS_BOUNDS_MAX_ONLY is stored as-is.

  • Where it comes in:
    • scene_load_item casts bounds_type from int64 (libobs/obs-scene.c.h around line 1067).
    • load_transform_states does the same with frontend undo data (around 2401).
    • The setters obs_sceneitem_set_bounds_type (around 2644-2648) and obs_sceneitem_set_info2 (around 2781) take any value.
  • What happens next: compute_item_transform treats any value other than OBS_BOUNDS_NONE as bounded. obs_bounds_fit_scale leaves the scale alone for an unknown type, so the item keeps its own scale inside a box the size of bounds, offset by that box's alignment.
  • What the user sees: the transform dialog shows no bounds type.
  • obs-websocket maps bounds types by name and falls back to NONE. Scene collections and plugins don't.

Plan

  1. RED: real-libobs tests for each entry point:

    • load a scene collection with bounds_type 99 and -1;
    • call the setter and set_info2 with an out-of-range value;
    • load undo transform data.

    Each must read back as OBS_BOUNDS_NONE and draw like an unbounded item. Every valid value must stay unchanged.

  2. GREEN: map an out-of-range bounds type to OBS_BOUNDS_NONE on load and in the setters.

Only a hand-edited or foreign scene file changes: its item draws at its own scale, without a phantom box.

Activity

  1. added
    bug
    on Oct 25, 2026
  2. rdoupe commented on Oct 25, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2281.

  3. added
    claimed
    on Oct 25, 2026
  4. added
    ready
    and removed
    claimed
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions