mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-27 16:14:13 +01:00
Add UBFIX for null deref in CameraObjectReset2
This commit is contained in:
parent
d74f739e05
commit
b155c307ea
@ -2275,7 +2275,18 @@ u8 CameraObjectGetFollowedObjectId(void)
|
||||
|
||||
void CameraObjectReset2(void)
|
||||
{
|
||||
// UB: Possible null dereference
|
||||
#ifdef UBFIX
|
||||
struct Sprite *cameraObject;
|
||||
|
||||
cameraObject = FindCameraObject();
|
||||
if (cameraObject != NULL)
|
||||
{
|
||||
cameraObject->data[1] = 2;
|
||||
}
|
||||
#else
|
||||
FindCameraObject()->data[1] = 2;
|
||||
#endif // UBFIX
|
||||
}
|
||||
|
||||
u8 CopySprite(struct Sprite *sprite, s16 x, s16 y, u8 subpriority)
|
||||
|
Loading…
x
Reference in New Issue
Block a user