Add UBFIX for null deref in CameraObjectReset2
This commit is contained in:
parent
d74f739e05
commit
b155c307ea
1 changed files with 11 additions and 0 deletions
|
@ -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…
Reference in a new issue