[Bf-blender-cvs] [1d0c238] blender-v2.73-release: Fix crash in texture paint sampling when sampling materials without textures slots

Antony Riakiotakis noreply at git.blender.org
Tue Jan 20 10:23:22 CET 2015


Commit: 1d0c23823d743184aa2bf424d1df0146407d86b1
Author: Antony Riakiotakis
Date:   Thu Jan 8 12:47:19 2015 +0100
Branches: blender-v2.73-release
https://developer.blender.org/rB1d0c23823d743184aa2bf424d1df0146407d86b1

Fix crash in texture paint sampling when sampling materials without
textures slots

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

M	source/blender/editors/sculpt_paint/paint_utils.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 12e7e81..427505b 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -395,7 +395,7 @@ static Image *imapaint_face_image(DerivedMesh *dm, int face_index)
 	Image *ima;
 	MFace *mf = dm->getTessFaceArray(dm) + face_index;
 	Material *ma = dm->mat[mf->mat_nr];
-	ima = ma ? ma->texpaintslot[ma->paint_active_slot].ima : NULL;
+	ima = ma && ma->texpaintslot ? ma->texpaintslot[ma->paint_active_slot].ima : NULL;
 
 	return ima;
 }




More information about the Bf-blender-cvs mailing list