You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
libobs: obs_output_set_mixer shifts by an unchecked index; obs_output_get_video_conversion dereferences NULL video #2127
There are two unchecked inputs in libobs/obs-output.c.h. Both are reachable only from plugins and scripts, and upstream has the same code. They were found while porting the output video checks (#2117) and scoping round 6 of the Rust port (R6-5).
1. obs_output_set_mixer() shifts by an unchecked index
output->mixer_mask = (size_t)1 << mixer_idx is undefined for mixer_idx >= 64 (or 32 on 32-bit builds).
For 6 to 63 it selects a mixer that does not exist, and obs_output_get_mixer() then reports 0, which is not what was set.
No caller in the frontend or the bundled plugins passes such an index. obs_output_set_preferred_size2() already ignores an index out of range for its own index.
2. obs_output_get_video_conversion() dereferences NULL with no video and a scaled size
When the output has a scaled size but no video, the scaled branch reads info->format from video_output_get_info(NULL), which returns NULL.
An output has no video when obs_output_set_media() was given NULL video, or when it was created before video was reset.
The other branches handle a NULL video, as do video_output_get_width() and video_output_get_height().
DeckLink calls this function. Its UI calls it with only a NULL check of the result, and decklink-device-instance dereferences the result directly.
Plan
RED: real-libobs tests.
obs_output_set_mixer() with 0 to 5, 6, 63, 64 and SIZE_MAX, checking the mask that obs_output_get_mixer() and obs_output_get_mixers() report.
obs_output_get_video_conversion() on an output with NULL video, with and without a scaled size.
Run under ASan/UBSan.
GREEN:
obs_output_set_mixer() logs and ignores an index >= MAX_AUDIO_MIXES, as obs_output_set_preferred_size2() does.
obs_output_get_video_conversion() returns NULL when the output has a scaled size but no video, since there is nothing to convert from.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2127.
libobs: Ignore an out-of-range output mixer index and a conversion wi…
obs-output: port obs_output_get_video_conversion to Rust (obs-rust#6104…