diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-20 08:45:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-20 08:45:01 +0400 |
commit | c61ab5f5d1e8aa042c49bbc3653c3509559f7ac3 (patch) | |
tree | d42abfd6e4ad110b9765ec6152fe06abe34e4692 | |
parent | 679105283259456e3e8213a62d68ee87a5254327 (diff) |
fix possible crasg in recent texface commit - material pointer could be used un-inirialized.
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 11 |
1 files 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; |