mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-27 00:44:04 -04:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user