diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2026-08-08 19:32:53 +0100 |
|---|---|---|
| committer | OatmealDome <julian@oatmealdome.me> | 2026-08-10 17:50:26 -0400 |
| commit | 5aa711db4144228435c41c6d4eacbab9cd6171db (patch) | |
| tree | eb0ca51236253c5990ffd33cbd0fb38d06958dc7 /Source/Core | |
| parent | 6d2e3a1ecc1f2b3b140b650eda9d9be5dc0a92e3 (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.cpp | 6 |
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) { |
