2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-27 07:05:43 +03:00

Fix potential crash

This commit is contained in:
s1lentq 2024-12-08 05:15:11 +07:00
parent 6e6368da30
commit 18b173d5c6

View File

@ -6076,7 +6076,7 @@ void PrecacheModelSounds(studiohdr_t *pStudioHeader)
void PrecacheModelSpecifiedFiles()
{
const char **s = &g_psv.model_precache[1];
for (size_t i = 1; i < ARRAYSIZE(g_psv.model_precache) && *s != nullptr; i++, s++)
for (size_t i = 1; i < ARRAYSIZE(g_psv.model_precache) && *s && g_psv.models[i]; i++, s++)
{
if (g_psv.models[i]->type != mod_studio)
continue;