DSPHLE/Zelda: prevent out-of-bounds stack read

Reported by @RickdeJager.
This commit is contained in:
Tillmann Karras
2026-08-09 15:56:21 +01:00
parent 216ffb4581
commit ce85da6b96
@@ -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)
{