From c61ab5f5d1e8aa042c49bbc3653c3509559f7ac3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 20 Sep 2011 04:45:01 +0000 Subject: [PATCH] fix possible crasg in recent texface commit - material pointer could be used un-inirialized. --- source/blender/editors/space_view3d/drawmesh.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 42ee6c0f00a..37abf01b0da 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -518,15 +518,14 @@ static int draw_em_tf_mapped__set_draw(void *userData, int index) static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r) { Mesh *me = (Mesh*)userData; - Material *ma; if (me->mface) { - int matnr = me->mface[index].mat_nr; - ma = me->mat[matnr]; - } + short matnr= me->mface[index].mat_nr; + Material *ma= me->mat[matnr]; - if ( ma && (ma->game.flag & GEMAT_INVISIBLE)) { - return 0; + if (ma && (ma->game.flag & GEMAT_INVISIBLE)) { + return 0; + } } *drawSmooth_r = 1;