Skip to content

bug: libobs: obs_add_module_path() leaves the module path type uninitialized #1900

Closed

Description

@rdoupe

Location

libobs/obs-module.c.h, obs_add_module_path() (same code upstream in libobs/obs-module.c).

Class

Correctness: an uninitialized field controls module loading.

How it is reached

obs_add_module_path(bin, data) builds a struct obs_module_path on the stack and sets only bin and data. Its type (enum obs_runtime_module_type) is never written. obs_find_modules2() then reports that type in each obs_module_info2, and the loading code branches on it:

  • whether a disabled module is skipped (info->type != OBS_MODULE_TYPE_CORE);
  • legacy-plugin handling (== OBS_MODULE_TYPE_LEGACY_PLUGIN);
  • duplicate handling.

No in-tree loader reads these paths today: upstream obsproject/obs-studio@11a8445aa4 (plugin manager 1.5) added type and set it only on the typed paths the frontend passes to obs_load_plugins(), and made obs_load_all_modules() empty. So the uninitialized value reaches only outside callers of obs_find_modules2(), and through them libobs's loader if they pass the reported info on. Upstream has the same code.

Proposed fix and failing test

Set type explicitly in obs_add_module_path() to OBS_MODULE_TYPE_UNDEFINED, which matches the behaviour before the type existed (the disabled list applies; no legacy-core skip) and the type obs_open_module() gives. Add a test that adds a path with obs_add_module_path(), then checks the type reported by obs_find_modules2() and the resulting disabled-module and legacy behaviour.

Activity

  1. rdoupe commented on Oct 23, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #1900.

  2. added
    claimed
    on Oct 23, 2026
  3. added a commit that references this issue on Oct 23, 2026
    3305519
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