From eadc0165256cad7c90a5bfb78aaacb86e4545336 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 5 Jul 2020 13:55:02 +0100 Subject: [PATCH] Lock the audio buffer lock when reading released buffers This is required to prevent races in Puyo Puyo Tetris and potentially other games. --- app/src/main/cpp/skyline/audio/track.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/cpp/skyline/audio/track.cpp b/app/src/main/cpp/skyline/audio/track.cpp index e87968eb..5aa5cdbd 100644 --- a/app/src/main/cpp/skyline/audio/track.cpp +++ b/app/src/main/cpp/skyline/audio/track.cpp @@ -32,6 +32,7 @@ namespace skyline::audio { std::vector AudioTrack::GetReleasedBuffers(u32 max) { std::vector bufferIds; + std::unique_lock trackGuard(bufferLock); for (u32 index = 0; index < max; index++) { if (!identifiers.back().released)