pret / pokefirered

Decompilation of Pokémon FireRed/LeafGreen
973 stars 555 forks source link

UB fix in battle_transition.c #662

Closed cawtds closed 1 month ago

cawtds commented 3 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