Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-20 08:45:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-20 08:45:01 +0400
commitc61ab5f5d1e8aa042c49bbc3653c3509559f7ac3 (patch)
treed42abfd6e4ad110b9765ec6152fe06abe34e4692 /source/blender
parent679105283259456e3e8213a62d68ee87a5254327 (diff)
fix possible crasg in recent texface commit - material pointer could be used un-inirialized.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c11
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;