[Bf-blender-cvs] [396a6d8] master: UPBGE: Fix crash when calling shade_light texture when mtex has no tex.

Ulysse Martin noreply at git.blender.org
Fri Sep 30 07:38:51 CEST 2016


Commit: 396a6d8a86f265c5fbb437b498b708a2f687a6f2
Author: Ulysse Martin
Date:   Fri Sep 30 07:40:17 2016 +0200
Branches: master
https://developer.blender.org/rB396a6d8a86f265c5fbb437b498b708a2f687a6f2

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

===================================================================

M	source/blender/gpu/intern/gpu_material.c

===================================================================

diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index ed9718f..b857aea 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -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;




More information about the Bf-blender-cvs mailing list