summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2026-08-08 19:32:53 +0100
committerOatmealDome <julian@oatmealdome.me>2026-08-10 17:50:26 -0400
commit5aa711db4144228435c41c6d4eacbab9cd6171db (patch)
treeeb0ca51236253c5990ffd33cbd0fb38d06958dc7 /Source/Core
parent6d2e3a1ecc1f2b3b140b650eda9d9be5dc0a92e3 (diff)
DSPHLE/Zelda: prevent out-of-bounds stack read
Reported by @RickdeJager.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp
index 5db3c55aa8..d73d965bcd 100644
--- a/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp
+++ b/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp
@@ -1715,6 +1715,12 @@ void ZeldaAudioRenderer::DownloadAFCSamplesFromARAM(s16* dst, VPB* vpb, u16 requ
return;
}
+ if (vpb->afc_remaining_decoded_samples > 0x10) [[unlikely]]
+ {
+ ERROR_LOG_FMT(DSPHLE, "afc_remaining_decoded_samples > 0x10");
+ vpb->afc_remaining_decoded_samples = 0x10;
+ }
+
// Try several things until we have output enough samples.
while (true)
{