prevent OOB write for BGM fix in grotto mixed pools (#5572)

This commit is contained in:
Eric Hoey 2025-06-11 17:35:49 -04:00 committed by GitHub
parent 40da9997c5
commit ad850e50b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -253,7 +253,9 @@ void Entrance_Init(void) {
for (s16 i = 0; i < 4; i++) {
// Zero out the bit in the field which tells the game to keep playing
// background music for all four scene setups at each index
gEntranceTable[override + i].field &= ~ENTRANCE_INFO_CONTINUE_BGM_FLAG;
if (override + i < ENTRANCE_TABLE_SIZE) {
gEntranceTable[override + i].field &= ~ENTRANCE_INFO_CONTINUE_BGM_FLAG;
}
}
}
}