Skip to content

fix(frontend): state the audio mixer bit masks the asan lane's sign-conversion check reports (#2938) - #2952

Merged
zackees merged 1 commit into
masterfrom
fix/2938-adv-audio-mixer-masks
Oct 29, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2938-adv-audio-mixer-masks

Conversation

@zackees

@zackees zackees commented Oct 29, 2026

Copy link
Copy Markdown
Member

Refs #2938 (one file of the frontend tail; the issue stays open until the whole group compiles).

RED (how it fails)

Sanitizers on master, asan 🧪, run 40919949570 (job 123611184270, head c2df54a7f):

frontend/components/OBSAdvAudioCtrl.cpp.hpp:533:45: error: conversion to 'uint32_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Werror=sign-conversion]
   533 |         new_mixers |= (1 << mixerIdx);
cc1plus: all warnings being treated as errors
ninja: build stopped: cannot make progress due to previous errors.

That run is the first asan build on master to get past plugins/obs-outputs/mp4-mux.c.h, so this is the next site the lane reaches, not a new regression. The lane compiles the app target with -Wconversion -Wsign-conversion -Werror.

GREEN (what this changes)

frontend/components/OBSAdvAudioCtrl.cpp.hpp:

  • setMixer(): new_mixers |= (1 << mixerIdx) -> 1u << mixerIdx, so the shifted value and the uint32_t accumulator stay unsigned. The ~(...) arm already used 1u.
  • The twelve mixers & (1 << n) reads that feed setChecked() / setCheckboxState() get the same 1u literal; mixers is uint32_t there and the int literal made the & mixed-sign.

No value changes: every shift count is a constant 0-5 or mixerIdx (0-5), well inside the 32-bit mask.

Evidence

…onversion check reports (#2938)

The Sanitizers lane compiles the app target with -Wconversion
-Wsign-conversion -Werror. setMixer() mixed an int shift into a uint32_t,
which the lane reports as:

  frontend/components/OBSAdvAudioCtrl.cpp.hpp:533:45: error: conversion to
  'uint32_t' from 'int' may change the sign of the result
  [-Werror=sign-conversion]

The same shape appears in the twelve 'mixers & (1 << n)' reads that feed
setChecked()/setCheckboxState(). The masks are unsigned now (1u), so the
expressions stay wholly unsigned; no value changes.
@zackees
zackees marked this pull request as ready for review October 29, 2026 18:31
@zackees
zackees added this pull request to the merge queue Oct 29, 2026
Merged via the queue into master with commit 3e6f6d9 Oct 29, 2026
39 checks passed
@zackees
zackees deleted the fix/2938-adv-audio-mixer-masks branch October 29, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant