diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2013-05-13 09:37:45 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2013-05-13 09:37:45 +0400 |
commit | 8576a275dcb2652d4593e473ea61e2033d27c553 (patch) | |
tree | b9037ca621dd2d89482f225b443234f28c96fcb9 /source | |
parent | 82612ae9502127a77a82b722189760995376f836 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 02cbcc980b2..547c4bb423b 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -630,9 +630,10 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl) 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]; |