Fix null pointer deference when attempting to load a model with improper or missing skin definitions

git-svn-id: https://svn.eduke32.com/eduke32@7019 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-10-07 05:21:39 +00:00
parent cab65752b5
commit 0d843526f0

View file

@ -677,7 +677,7 @@ int32_t mdloadskin(md2model_t *m, int32_t number, int32_t pal, int32_t surf)
if (pal >= (MAXPALOOKUPS - RESERVEDPALS))
for (i=0; i<nextmodelid; i++)
for (skzero = ((md2model_t *)models[i])->skinmap; skzero; skzero = skzero->next)
if (!Bstrcasecmp(skzero->fn, sk->fn) && skzero->texid[hicfxid(pal)])
if (!Bstrcasecmp(skzero->fn, sk->fn) && skzero->texid[hicfxid(pal)] && sk)
{
size_t f = hicfxid(pal);