From 945f70222a72611fe8dd1a6b59dfc6c7e512e176 Mon Sep 17 00:00:00 2001 From: David Racine Date: Sun, 23 Aug 2026 08:37:51 -0400 Subject: [PATCH] Restore the realId assignment in AudioLoad_AsyncLoadInner (#7105) The function declares realId and then indexes with it thirteen times - the load-status tables, AudioLoad_SearchCaches, the table entry it reads size and address from, every cache allocation, and the status write at the end - but nothing assigns it. It has read an uninitialised local since "Custom Sequences" (#2066) dropped the assignment in 2022. Restoring the line puts back the value the rest of the function expects. For SEQUENCE_TABLE and FONT_TABLE, AudioLoad_GetRealTableIndex returns the id unchanged, so this is only a correctness fix in practice: the paths that reach this function today go through the sequence script's async load command, which is rare enough that the garbage index has not been tied to any report. --- soh/src/code/audio_load.c | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index 5374b38b5a..239e312f32 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -1006,6 +1006,7 @@ void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, u32 temp_v0; u32 realId; + realId = AudioLoad_GetRealTableIndex(tableType, id); switch (tableType) { case SEQUENCE_TABLE: if (gAudioContext.seqLoadStatus[realId] == 1) {