From 2306e094b28620f0e323bf4af61f8e00450e38fa Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Mon, 21 Feb 2022 21:01:28 -0300 Subject: [PATCH] Fix oob access in Matrix_SetTranslateScaleMtx2 (#1152) --- src/code/sys_matrix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/code/sys_matrix.c b/src/code/sys_matrix.c index b903a77b17..9f44a99318 100644 --- a/src/code/sys_matrix.c +++ b/src/code/sys_matrix.c @@ -1118,7 +1118,7 @@ void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, (*m)[2][1] = 0; (*m)[0][3] = 0; (*m)[2][3] = 0; - (*m)[0][4] = 0; + (*m)[1][0] = 0; fixedPoint = (s32)(scaleX * 0x10000); (*m)[0][0] = fixedPoint; @@ -1134,7 +1134,7 @@ void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, intPart[11] = 0; (*m)[3][1] = fixedPoint << 16; - (*m)[2][4] = 0; + (*m)[3][0] = 0; fixedPoint = (s32)(translateX * 0x10000); intPart[12] = (fixedPoint >> 16) & 0xFFFF;