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.
This commit is contained in:
David Racine
2026-08-23 08:37:51 -04:00
committed by GitHub
parent 7a7f942b8e
commit 945f70222a
+1
View File
@@ -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) {