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
bug: libobs: a NaN or negative source volume isn't rejected and breaks every mix the source is in #2108
A source's volume is never range-checked. obs_source_set_volume() stores any float, and so does the scene-collection load in obs_load_source() (libobs/obs.c.h, "volume").
NaN: a NaN volume passes the snap in get_source_volume(), so every sample of that source becomes NaN. NaN spreads through addition, so every mix the source is in becomes NaN too: the whole track goes silent or turns to noise, depending on the output.
Negative: a negative volume inverts the phase.
Infinite: ±inf gives inf or NaN samples, the same as NaN.
The Mixer UI and obs-websocket's SetInputVolume only produce valid values, so this needs an edited scene collection, a plugin or a script. Upstream has the same code. Found while scoping round 6 of the Rust port (R6-1). It's the volume counterpart of #2051, which clamped the balance.
Plan
RED: tests through the setter and a loaded scene collection, with volumes of NaN, -1, ±inf, 0, 1 and a large finite value. They check the getter and that the source's mixed audio stays finite. test_source_audio_ranges (libobs: Saturate push-to-talk stop times and clamp the audio balance #2058) is a model.
GREEN: in the setter and on load, turn NaN into the default 1.0 and clamp negative values to 0, matching libobs: Saturate push-to-talk stop times and clamp the audio balance #2058's balance clamp. Pick and document a sane upper bound for infinity: the largest value the UI or websocket allows, or no clamp for finite values. Every value that is valid today must behave exactly as before.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2108.
libobs: Keep source volumes finite and non-negative (obs-rust#2128)
test: Characterize the source volume multiply kernels
obs-source: Port the source volume multiply kernels (obs-rust#3080) (o…