Fix memory corruption in sound init

This commit is contained in:
MysterD 2022-04-13 20:36:52 -07:00
parent 757cad4fbc
commit bf315f266f
2 changed files with 3 additions and 2 deletions

View file

@ -268,6 +268,7 @@ void *soundAlloc(struct SoundAllocPool *pool, u32 size) {
u32 alignedSize = ALIGN16(size);
if (pool == NULL || pool->cur == NULL) {
fprintf(stderr, "soundAlloc failed: pull was invalid\n");
return NULL;
}

View file

@ -1984,8 +1984,8 @@ void audio_init() {
// Load bank sets for each sequence (assets/bank_sets.s)
data = LOAD_DATA(gBankSetsData);
gAlBankSets = soundAlloc(&gAudioInitPool, 0x800);
audio_dma_copy_immediate((uintptr_t)data, gAlBankSets, 0x800);
gAlBankSets = soundAlloc(&gAudioInitPool, 160);
audio_dma_copy_immediate((uintptr_t)data, gAlBankSets, 160);
init_sequence_players();
gAudioLoadLock = AUDIO_LOCK_NOT_LOADING;