fixed a NULL pointer dereference crash in RB_CalcDiffuseColor

This commit is contained in:
myT 2017-07-06 05:41:03 +02:00
parent 265cca7eb6
commit 1c6bae1eb7

View file

@ -1044,7 +1044,11 @@ void RB_CalcDiffuseColor( unsigned char *colors )
vec3_t lightDir; vec3_t lightDir;
vec3_t directedLight; vec3_t directedLight;
int numVertexes; int numVertexes;
ent = backEnd.currentEntity; ent = backEnd.currentEntity;
if (!ent || !tess.numVertexes)
return;
ambientLightInt = ent->ambientLightInt; ambientLightInt = ent->ambientLightInt;
VectorCopy( ent->ambientLight, ambientLight ); VectorCopy( ent->ambientLight, ambientLight );
VectorCopy( ent->directedLight, directedLight ); VectorCopy( ent->directedLight, directedLight );