Changed missing line ending style for TEX_ files
authorKent Mein <mein@cs.umn.edu>
Tue, 24 Mar 2009 19:39:02 +0000 (19:39 +0000)
committerKent Mein <mein@cs.umn.edu>
Tue, 24 Mar 2009 19:39:02 +0000 (19:39 +0000)
in sculptmode.c move initalization of a var to fix an issue
where index of array could be -1.
Found by coverity.

Kent

source/blender/src/sculptmode.c

index c534a8b3cab24613d3ef17c18fe924a2cae057b9..ca04952392861af2d0c8345b0b087fd3d4696557 100644 (file)
@@ -1175,7 +1175,7 @@ void sculptmode_update_tex()
 {
        SculptData *sd= sculpt_data();
        SculptSession *ss= sculpt_session();
-       MTex *mtex = sd->mtex[sd->texact];
+       MTex *mtex;
        TexResult texres = {0};
        float x, y, step=2.0/TC_SIZE, co[3];
        int hasrgb, ix, iy;
@@ -1183,6 +1183,8 @@ void sculptmode_update_tex()
        /* Skip Default brush shape and non-textures */
        if(sd->texact == -1 || !sd->mtex[sd->texact]) return;
 
+       mtex = sd->mtex[sd->texact];
+
        if(ss->texcache) {
                MEM_freeN(ss->texcache);
                ss->texcache= NULL;