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

Reported by @RickdeJager.
This commit is contained in:
Tillmann Karras
2026-08-08 19:32:53 +01:00
committed by OatmealDome
parent 44dd6aad30
commit 5888eb6eb6

View File

@@ -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)
{