fix: SG-42334: Fix random crashes involving SoundTrackIPNode#1152
Open
bernie-laberge wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Open
fix: SG-42334: Fix random crashes involving SoundTrackIPNode#1152bernie-laberge wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
bernie-laberge wants to merge 1 commit intoAcademySoftwareFoundation:mainfrom
Conversation
a338bec to
0d20272
Compare
cedrik-fuoco-adsk
approved these changes
Feb 27, 2026
eloisebrosseau
approved these changes
Feb 27, 2026
There was a problem hiding this comment.
Pull request overview
Fixes random crashes in SoundTrackIPNode by adding synchronization around waveform framebuffer (m_fb) usage and by centralizing the default audio packet size into a shared constant.
Changes:
- Add mutex protection around
m_fballocation/restructure/clearing and re-checkm_fbunder lock before dereference inevaluateAudioTexture(). - Introduce
TWEAK_AUDIO_DEFAULT_PACKET_SIZE(2048) and replace hardcoded packet-size defaults across audio/cache/movie components. - Update
IPGraphto use the shared default packet size instead of platform-specific hardcoded defaults.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/ip/IPCore/SoundTrackIPNode.cpp | Adds locking around framebuffer access/clear and re-checks m_fb before creating the waveform IPImage. |
| src/lib/ip/IPCore/IPGraph.cpp | Uses TWEAK_AUDIO_DEFAULT_PACKET_SIZE for m_audioPacketSize and includes TwkAudio/Audio.h. |
| src/lib/image/MovieRV_FBO/MovieRV_FBO/MovieRV_FBO.h | Replaces default audioPacketSize argument with TWEAK_AUDIO_DEFAULT_PACKET_SIZE. |
| src/lib/image/MovieRV_FBO/MovieRV_FBO.cpp | Updates member default m_audioPacketSize to TWEAK_AUDIO_DEFAULT_PACKET_SIZE. |
| src/lib/image/MovieRV/MovieRV/MovieRV.h | Replaces default audioPacketSize argument with TWEAK_AUDIO_DEFAULT_PACKET_SIZE. |
| src/lib/image/MovieRV/MovieRV.cpp | Updates member default m_audioPacketSize to TWEAK_AUDIO_DEFAULT_PACKET_SIZE. |
| src/lib/audio/TwkAudio/TwkAudio/Audio.h | Defines and documents TWEAK_AUDIO_DEFAULT_PACKET_SIZE (2048). |
| src/lib/audio/TwkAudio/AudioCache.cpp | Uses TWEAK_AUDIO_DEFAULT_PACKET_SIZE as the default cache packet size. |
Signed-off-by: Bernard Laberge <bernard.laberge@autodesk.com>
0d20272 to
e4613e0
Compare
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.
fix: SG-42334: Fix random crashes involving SoundTrackIPNode
Linked issues
NA
Summarize your change.
IPImage — guarding against propertyChanged() clearing m_fb on the main thread between the two access points.
Root Cause
m_fb (the waveform framebuffer) was read and written from multiple threads without synchronization. evaluateAudioTexture() ran on the audio/render thread while
propertyChanged() and clearFB() ran on the main thread. A m_fb pointer that was valid at the check could be freed mid-use, leading to use-after-free crashes.
Describe the reason for the change.
Random crashes had been reported originating from SoundTrackIPNode.
Describe what you have tested and on which operating system.
Successfully tested on macOS.
Test Plan
Add a list of changes, and note any that might need special attention during the review.
If possible, provide screenshots.