Add UBFIX for null deref in CameraObjectReset2
This commit is contained in:
@@ -2275,7 +2275,18 @@ u8 CameraObjectGetFollowedObjectId(void)
|
|||||||
|
|
||||||
void CameraObjectReset2(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;
|
FindCameraObject()->data[1] = 2;
|
||||||
|
#endif // UBFIX
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 CopySprite(struct Sprite *sprite, s16 x, s16 y, u8 subpriority)
|
u8 CopySprite(struct Sprite *sprite, s16 x, s16 y, u8 subpriority)
|
||||||
|
|||||||
Reference in New Issue
Block a user