mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-09-10 03:42:00 -04:00
Fix array overflow in chrnum lookup
This commit is contained in:
+1
-1
@@ -5369,7 +5369,7 @@ void chrsCheckForNoise(f32 noiseradius)
|
||||
|
||||
struct chrdata *chrFindByLiteralId(s32 chrnum)
|
||||
{
|
||||
if (g_ChrIndexesByChrnum[chrnum] >= 0) {
|
||||
if (chrnum >= 0 && chrnum < ARRAYCOUNT(g_ChrIndexesByChrnum) && g_ChrIndexesByChrnum[chrnum] >= 0) {
|
||||
return &g_ChrSlots[g_ChrIndexesByChrnum[chrnum]];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user