Free the allocated buffer before the second decompression call (hopefully helps) (#8301)

This commit is contained in:
FosterProgramming 2025-12-08 22:56:51 +01:00 committed by GitHub
parent 37a0ef9941
commit aa172aad6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1575,9 +1575,9 @@ void LoadMoveBg(u16 bgId)
void *decompressionBuffer = malloc_and_decompress(gBattleAnimBackgroundTable[bgId].tilemap, NULL);
RelocateBattleBgPal(GetBattleBgPaletteNum(), decompressionBuffer, 0x100, FALSE);
DmaCopy32(3, decompressionBuffer, (void *)BG_SCREEN_ADDR(26), 0x800);
Free(decompressionBuffer);
DecompressDataWithHeaderVram(gBattleAnimBackgroundTable[bgId].image, (void *)BG_SCREEN_ADDR(4));
LoadPalette(gBattleAnimBackgroundTable[bgId].palette, BG_PLTT_ID(GetBattleBgPaletteNum()), PLTT_SIZE_4BPP);
Free(decompressionBuffer);
}
else
{