From 6020d2cb45322c0dfa3d9548cca62318b7a6491c Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Tue, 24 Mar 2009 19:39:02 +0000 Subject: [PATCH] Changed missing line ending style for TEX_ files 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c index c534a8b3cab..ca049523928 100644 --- a/source/blender/src/sculptmode.c +++ b/source/blender/src/sculptmode.c @@ -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;