mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-25 05:41:42 +00:00
Fix segfault when setting forceskin to None
This commit is contained in:
parent
ce1901a3bb
commit
1718361123
1 changed files with 3 additions and 4 deletions
|
@ -2065,10 +2065,9 @@ static void CV_SetValueMaybeStealth(consvar_t *var, INT32 value, boolean stealth
|
||||||
if (var == &cv_forceskin) // Special handling.
|
if (var == &cv_forceskin) // Special handling.
|
||||||
{
|
{
|
||||||
const char *tmpskin = NULL;
|
const char *tmpskin = NULL;
|
||||||
if ((value < 0) || (value >= numskins))
|
if (value >= 0 && value < numskins)
|
||||||
;
|
|
||||||
else
|
|
||||||
tmpskin = skins[value]->name;
|
tmpskin = skins[value]->name;
|
||||||
|
if (tmpskin)
|
||||||
memcpy(val, tmpskin, SKINNAMESIZE);
|
memcpy(val, tmpskin, SKINNAMESIZE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue