Prevent some array lookups in c_cc_d and c_math from going out of bounds

This commit is contained in:
Irastris
2026-03-31 04:33:08 -04:00
parent a83c53cf37
commit 15b63c84ee
2 changed files with 18 additions and 0 deletions
+3
View File
@@ -109,6 +109,9 @@ static u16 atntable[1025] = {
u16 U_GetAtanTable(f32 f0, f32 f1) {
int idx = f0 / f1 * 0x400;
#if TARGET_PC
idx = idx < 0 ? 0 : idx > 0x400 ? 0x400 : idx;
#endif
return atntable[idx];
}