Skip to content

fix(app): guard against invalid range in applyMuteMask#5

Merged
pasrom merged 2 commits intomainfrom
fix/mute-mask-range-crash
Mar 12, 2026
Merged

fix(app): guard against invalid range in applyMuteMask#5
pasrom merged 2 commits intomainfrom
fix/mute-mask-range-crash

Conversation

@pasrom
Copy link
Copy Markdown
Owner

@pasrom pasrom commented Mar 12, 2026

Summary

  • Fixes crash in AudioMixer.applyMuteMask when micDelay exceeds mute timeline timestamps
  • The clamped range lower..<upper could have lower > upper, causing a Swift Range precondition failure (EXC_BREAKPOINT)
  • Now skips empty/inverted ranges with guard lower < upper else { continue }

Test plan

  • 411 tests pass
  • Crash reproduced via crash report (AudioMixer.swift:127)

pasrom added 2 commits March 12, 2026 08:15
When micDelay exceeds mute timeline timestamps, the clamped range
end could be less than start, causing a Range precondition failure.
Skip empty/inverted ranges instead of crashing.
Cover the crash scenario: large micDelay producing inverted range,
and partial negative range where mute starts before recording.
@pasrom pasrom merged commit c2811c1 into main Mar 12, 2026
1 check passed
@pasrom pasrom deleted the fix/mute-mask-range-crash branch March 12, 2026 07:23
@pasrom pasrom added the bug Something isn't working label Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant