From c60f9f3e46b71e1a93bf9dc9d0166bfe77bdb8d2 Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 27 Feb 2022 01:05:36 -0800 Subject: [PATCH] Prevent crash in anim_spline_poll --- src/engine/math_util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/engine/math_util.c b/src/engine/math_util.c index af3fd82f..ca8b6ce1 100644 --- a/src/engine/math_util.c +++ b/src/engine/math_util.c @@ -889,6 +889,9 @@ s32 anim_spline_poll(struct MarioState* m, Vec3f result) { vec3f_copy(result, gVec3fZero); spline_get_weights(m, weights, m->splineKeyframeFraction, m->splineState); + + if (m->splineKeyframe == NULL) { return FALSE; } + for (i = 0; i < 4; i++) { result[0] += weights[i] * m->splineKeyframe[i][1]; result[1] += weights[i] * m->splineKeyframe[i][2];