1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 12:54:51 +00:00

Fix oob access in Matrix_SetTranslateScaleMtx2 (#1152)

This commit is contained in:
Anghelo Carvajal 2022-02-21 21:01:28 -03:00 committed by GitHub
parent 145b14dbc4
commit 2306e094b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1118,7 +1118,7 @@ void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ,
(*m)[2][1] = 0; (*m)[2][1] = 0;
(*m)[0][3] = 0; (*m)[0][3] = 0;
(*m)[2][3] = 0; (*m)[2][3] = 0;
(*m)[0][4] = 0; (*m)[1][0] = 0;
fixedPoint = (s32)(scaleX * 0x10000); fixedPoint = (s32)(scaleX * 0x10000);
(*m)[0][0] = fixedPoint; (*m)[0][0] = fixedPoint;
@ -1134,7 +1134,7 @@ void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ,
intPart[11] = 0; intPart[11] = 0;
(*m)[3][1] = fixedPoint << 16; (*m)[3][1] = fixedPoint << 16;
(*m)[2][4] = 0; (*m)[3][0] = 0;
fixedPoint = (s32)(translateX * 0x10000); fixedPoint = (s32)(translateX * 0x10000);
intPart[12] = (fixedPoint >> 16) & 0xFFFF; intPart[12] = (fixedPoint >> 16) & 0xFFFF;