Fix crash in AudioUnit backend due to off-by-one error in parameter syncing#15919
Merged
daschuer merged 1 commit intomixxxdj:2.5from Feb 3, 2026
Merged
Fix crash in AudioUnit backend due to off-by-one error in parameter syncing#15919daschuer merged 1 commit intomixxxdj:2.5from
daschuer merged 1 commit intomixxxdj:2.5from
Conversation
Member
|
Nice catch. This 1 line PR was probably more work than others with 1000 lines. Thank you for that. Can you please rebase it to 2.5? The issue is already present there. "git rebase --onto=2.5 HEAD~1" |
This fixes a crash on macOS (Debug builds) where syncing AudioUnit parameters caused an index-out-of-bounds error. The loop condition failed to grow the list when (e.g., initially 0), causing to access invalid memory.
92e3564 to
334cd36
Compare
Contributor
Author
It did take me hours of digging into the codebase after struggling to continue my work on other features due to crashes. I hope others benefit from this and save time. 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Description
Fixes a crash on macOS when using AudioUnit effects in a Debug build.
The
syncParameters()method had an off-by-one error when growing them_lastValueslist.When
i=0and the list is empty:if (m_lastValues.size() < i)(0 < 0) evaluated to false.m_lastValues[i]caused an index-out-of-bounds assertion failure.Reproduction Steps
-DCMAKE_BUILD_TYPE=Debug).AudioUnitEffectProcessor).ASSERT failure in QList::operator[]: "index out of range".The Fix
Changed the condition to
if (m_lastValues.size() <= i)to ensure the list grows correctly whensize == index.Verification
Run this command on a Mac to verify the crash (before the fix) and the solution (after the fix):