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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-01-13 21:13:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-01-13 21:13:39 +0300
commit67de673496a056c1f807717865a0f73c4e1aca9f (patch)
treefe73afbf9ac96c4003eaf9895628b036d0135278 /source
parent52d283d1ab2183a4c0a4c4ed128ce3b1e64c9e90 (diff)
Bugfix, un-initialized variables for tubemap and spheremap mapping, affected textures
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/intern/arithb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index 1197e710806..cf02fc67ec4 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -3415,6 +3415,8 @@ void tubemap(float x, float y, float z, float *u, float *v)
len= sqrt(x*x+y*y);
if(len>0) {
*u = (1.0 - (atan2(x/len,y/len) / M_PI)) / 2.0;
+ } else {
+ *v = *u = 0.0f; /* to avoid un-initialized variables */
}
}
@@ -3432,6 +3434,8 @@ void spheremap(float x, float y, float z, float *u, float *v)
z/=len;
*v = 1.0- saacos(z)/M_PI;
+ } else {
+ *v = *u = 0.0f; /* to avoid un-initialized variables */
}
}