mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-27 08:47:30 -04:00
27b71b1a54
#6917 guarded the three seqLoadStatus accessors against sequenceMapSize because the array was allocated at exactly that size, so a custom sequence id past it read and wrote off the end. #6932 sized the array to sequenceMapSize + 0xF to match sequenceMap, which covers the whole id space rather than rejecting the ids outside it, and also protects the writers those guards never saw: AudioHeap_AllocCached and AudioHeap_PopCache index seqLoadStatus directly. The guards are now not just redundant but bounded wrong - they treat the ids in [sequenceMapSize, sequenceMapSize + 0xF) as absent from a table that now has room for them. Nothing breaks today because every entry starts at 5, so AudioLoad_IsSeqLoadComplete answers true regardless and AudioLoad_SetSeqLoadStatus already declines to overwrite a 5 - but once the heap cache path moves such an entry off 5, the guard blocks an update that should happen. Reverting them restores the three functions to their decompiled form. The sizing from #6932 and the id check in AudioLoad_SyncInitSeqPlayerInternal remain the actual protection.