UPBGE: Fix crash when calling shade_light texture when mtex has no tex.

This commit is contained in:
Ulysse Martin 2016-09-30 07:40:17 +02:00 committed by Porteries Tristan
parent 80837d06de
commit 396a6d8a86
Notes: blender-bot 2023-02-14 10:21:15 +01:00
Referenced by issue #49484, Bug: Crash when MTex has no tex
1 changed files with 1 additions and 1 deletions

View File

@ -804,7 +804,7 @@ static void shade_light_textures(GPUMaterial *mat, GPULamp *lamp, GPUNodeLink **
for (int i = 0; i < MAX_MTEX; ++i) {
MTex *mtex = lamp->la->mtex[i];
if (mtex && mtex->tex->type & TEX_IMAGE && mtex->tex->ima) {
if (mtex && mtex->tex && (mtex->tex->type & TEX_IMAGE) && mtex->tex->ima) {
mat->dynproperty |= DYN_LAMP_PERSMAT;
float one = 1.0f;