[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56745] trunk/blender/source/blender/ editors/space_view3d/drawmesh.c: BGE: Fix for [#35320] " Crash When Adding Property without Setting Material" reported by Leon Cheung.

Mitchell Stokes mogurijin at gmail.com
Mon May 13 07:37:45 CEST 2013


Revision: 56745
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56745
Author:   moguri
Date:     2013-05-13 05:37:45 +0000 (Mon, 13 May 2013)
Log Message:
-----------
BGE: Fix for [#35320] "Crash When Adding Property without Setting Material" reported by Leon Cheung.

Adding an extra NULL check to draw_mesh_text() to avoid accessing a NULL material array.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawmesh.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawmesh.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2013-05-13 05:29:58 UTC (rev 56744)
+++ trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2013-05-13 05:37:45 UTC (rev 56745)
@@ -630,9 +630,10 @@
 	for (a = 0, mp = mface; a < totpoly; a++, mtpoly++, mp++) {
 		short matnr = mp->mat_nr;
 		int mf_smooth = mp->flag & ME_SMOOTH;
-		Material *mat = me->mat[matnr];
+		Material *mat = (me->mat) ? me->mat[matnr] : NULL;
 		int mode = mat ? mat->game.flag : GEMAT_INVISIBLE;
 
+
 		if (!(mode & GEMAT_INVISIBLE) && (mode & GEMAT_TEXT) && mp->totloop >= 3) {
 			/* get the polygon as a tri/quad */
 			int mp_vi[4];




More information about the Bf-blender-cvs mailing list