[SP/MP] Fix mangling of non-dynamic background music file path from pointer overlap#1334
Open
TwelveEyes wants to merge 1 commit into
Open
[SP/MP] Fix mangling of non-dynamic background music file path from pointer overlap#1334TwelveEyes wants to merge 1 commit into
TwelveEyes wants to merge 1 commit into
Conversation
…tBackgroundTrack_Actual`
taysta
approved these changes
Jun 22, 2026
taysta
left a comment
Contributor
There was a problem hiding this comment.
Noticed this caused a crash on mac when debugging events logging, I think the CI just failed due to a github outage and will pass if re-ran
Contributor
Author
From the log, it failed at the repo checkout step (it couldn't resolve github.com lol). As you said, just a GitHub hiccup that caused it to fail. |
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.
Non-dynamic background music (such as in JO's
yavin_templemap) is unable to loop after playing once due to file path mangling.sMusic_BackgroundLoopis passed toS_StartBackgroundTrack_Actualas argumentloop(fourth arg) here (line 4815):OpenJK/code/client/snd_dma.cpp
Lines 4813 to 4816 in 8cce3ea
This causes a pointer overlap (
sMusic_BackgroundLoopandlooppoint to the same memory address) inQ_StrncpyzinS_StartBackgroundTrack_Actualhere (line 4088):OpenJK/code/client/snd_dma.cpp
Lines 4082 to 4088 in 8cce3ea
This mangles the path and prevents the music file from being looped (as it can't be found). Adding a pointer comparison stops the overlap operation from mangling the path.