From 9ffd99473d03bff78338c1b0a4548f1a3141aabe Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 10 Apr 2023 17:50:57 -0700 Subject: [PATCH] Fix crash in is_anim_past_frame() --- src/game/mario.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game/mario.c b/src/game/mario.c index abe156b07..d1cdb75ea 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -176,7 +176,11 @@ void set_anim_to_frame(struct MarioState *m, s16 animFrame) { s32 is_anim_past_frame(struct MarioState *m, s16 animFrame) { s32 isPastFrame; s32 acceleratedFrame = animFrame << 0x10; + + if (!m || !m->marioObj) { return TRUE; } struct AnimInfo *animInfo = &m->marioObj->header.gfx.animInfo; + + if (!animInfo->curAnim) { return TRUE; } struct Animation *curAnim = animInfo->curAnim; if (animInfo->animAccel) {