diff options
| author | David Racine <bass_dr@hotmail.com> | 2026-08-03 17:05:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-03 21:05:07 +0000 |
| commit | eafafe507ebe0dd9bb8917552c840f9f78574189 (patch) | |
| tree | 4147c584f748b39370a440ebaa8f5c4c0cd51575 /soh/src/code/code_800FC620.c | |
| parent | 6889132708fe1f3df628802cb5c3bcd1bed714db (diff) | |
fix: seqLoadStatus OOB reads/writes for custom SAF sequences (#6917)
Custom SAF sequence IDs can exceed sequenceMapSize, causing out-of-bounds
reads/writes on the seqLoadStatus byte array (sized exactly sequenceMapSize).
This is the direct cause of intermittent battle music failure with BGM packs
(issue #5706): on the second encounter, AudioLoad_SyncLoadSeq reads a garbage
value from heap memory past seqLoadStatus[] and may find 1 (loading in
progress), causing it to return NULL early — the sequence player is never
initialized and no battle music plays.
Symmetric fix to the fontLoadStatus guards in PR #6916:
- AudioLoad_IsSeqLoadComplete: return true for OOB seqIds (custom SAF
sequences are resource-manager-backed, not in the async-load status table)
- AudioLoad_SetSeqLoadStatus: skip update for seqId >= sequenceMapSize
- AudioLoad_SyncLoadSeq: skip the in-progress check for OOB seqIds
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'soh/src/code/code_800FC620.c')
0 files changed, 0 insertions, 0 deletions
