[Bf-blender-cvs] [c8e61ca] depsgraph_refactor: Debsgraph: Fix crash when having texture slot without texture

Sergey Sharybin noreply at git.blender.org
Fri Dec 12 11:57:43 CET 2014


Commit: c8e61ca53dd5d2aec6379d4684218d03ed5092d5
Author: Sergey Sharybin
Date:   Fri Dec 12 15:57:17 2014 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rBc8e61ca53dd5d2aec6379d4684218d03ed5092d5

Debsgraph: Fix crash when having texture slot without texture

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

M	source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
M	source/blender/depsgraph/intern/depsgraph_build_relations.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
index eb9d248..86c5120 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cpp
@@ -830,7 +830,7 @@ void DepsgraphNodeBuilder::build_texture_stack(DepsNode *owner_node, MTex **text
 	/* for now assume that all texture-stacks have same number of max items */
 	for (i = 0; i < MAX_MTEX; i++) {
 		MTex *mtex = texture_stack[i];
-		if (mtex)
+		if (mtex && mtex->tex)
 			build_texture(owner_node, mtex->tex);
 	}
 }
diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
index 9ce5969..650a3cf 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@ -1311,7 +1311,7 @@ void DepsgraphRelationBuilder::build_texture_stack(ID *owner, MTex **texture_sta
 	/* for now assume that all texture-stacks have same number of max items */
 	for (i = 0; i < MAX_MTEX; i++) {
 		MTex *mtex = texture_stack[i];
-		if (mtex)
+		if (mtex && mtex->tex)
 			build_texture(owner, mtex->tex);
 	}
 }




More information about the Bf-blender-cvs mailing list