Effect-chain processing can write past the original buffer when non-in-place effects expand channel count #404
Labels
No labels
Bug
Extensions
New Feature
Not our bug - SDL2
Not our bug - WMA
Utilities
Wine
X3DAudio Accuracy
XACT Accuracy
XAudio2 Accuracy
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-FNA-XNA/FAudio#404
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
FAudio already has a FIXME in
FAudio_INTERNAL_ProcessEffectChainfor this case:I confirmed this as a real out-of-bounds write with a regression test in my hard fork:
github.com/sbvoxel/ForgeAudio@cb2532e9d5The failing shape is:
So the overflow happens before the second effect’s Process call.
In my fork, I fixed this by adding a second reusable scratch buffer and making non-in-place effects ping-pong between scratch buffers instead of writing expanded output back into the original input buffer.
The fix is probably not directly PR-ready because my fork has renamed APIs/types, but the regression test and the buffer-flow issue should be easy to inspect. This was AI-assisted work, so please treat the linked commit as a starting point for review rather than a drop-in upstream patch.
You may also be interested in these:
github.com/sbvoxel/ForgeAudio@13dcaf33c6github.com/sbvoxel/ForgeAudio@4b55c6ead6Again, AI work.
I'm only highlighting what seems most important.
Two of the newest AI models think we fixed a wrong cone direction:
github.com/sbvoxel/ForgeAudio@b0dcba6380Out of bounds issue fixed:
github.com/sbvoxel/ForgeAudio@3c317a64f6I'm not going to create an issue per finding, because again this is AI work. But I do find it a good idea to leave a thread here for the largest findings if someone wants to take something from this for FAudio.