Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UE 5.4] Spatialization crash when SteamAudioSourceComponent owner actor is destroyed while playing sound. #378

Open
SkacikPL opened this issue Sep 25, 2024 · 1 comment

Comments

@SkacikPL
Copy link

System Information
Please provide the following information about your system:

  • Steam Audio version: 4.5.3
  • (If applicable) Unity version: N/A
  • (If applicable) Unreal Engine version: 5.4
  • (If applicable) FMOD Studio version: N/A
  • Operating System and version: W11 23H2
  • (Optional) CPU architecture (e.g. x86-64, armv7): x64

Issue Description
SteamAudioSpatialization.cpp at line 344 checks whether pointer for SteamAudioSourceComponent exists but does not check whether it's valid. As a result it can be submitted for processing while object is marked for deletion by garbage collector, resulting in Steam Audio accessing invalid pointers and crashing.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Create an actor with audio and steam audio components.
  2. Set it up so actor is destroyed while playing sound.
  3. In non-editor builds, the actor will be instantly garbage collected resulting in steam audio module crash (if user does not click on fatal error prompt, the game will keep running albeit without any sound).

No dumps but solution is simple, SteamAudioSourceComponent pointer check at line 344 in SteamAudioSpatialization.cpp needs to be wrapped in UEs IsValid() check to make sure that components pending deletion are no longer submitted to steam audio.

@lakulish
Copy link
Collaborator

lakulish commented Oct 7, 2024

@SkacikPL Thanks for reporting the issue. If you would like, feel free to open a pull request with the fix, and I can merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants