pret / pokeemerald

Decompilation of Pokémon Emerald
2.2k stars 2.36k forks source link

UB fix in battle_transition.c #2007

Closed cawtds closed 3 weeks ago

cawtds commented 2 months ago

Description

When starting a wild cave encounter InitBlackWipe is called in ClockwiseWipe_TopRight with -1 for endY. This results in sTransitionData->tWipeCurrY ending up being -1 aswell, which is then used to access gScanlineEffectRegBuffers[0][sTransitionData->tWipeCurrY] leading to UB.

Discord contact info

.cawt