diff options
| author | Eric Hoey <121978037+A-Green-Spoon@users.noreply.github.com> | 2025-06-11 17:35:49 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-11 14:35:49 -0700 |
| commit | ad850e50b10f75df541dad5e8bf1ff506be5befa (patch) | |
| tree | 07e054bd8cdbc1a9eea02b05aeca9f2eac2f2da5 | |
| parent | 40da9997c59436d9acc52ba8a86b6c77a050b913 (diff) | |
prevent OOB write for BGM fix in grotto mixed pools (#5572)
| -rw-r--r-- | soh/soh/Enhancements/randomizer/randomizer_entrance.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index faec117eb..e32223124 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -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; + } } } } |
