osg::Uniform::get does not return a value on error.

Fixes "usage of uninitialized data" errors reported by valgrind.
This commit is contained in:
ThorstenB
2012-03-26 21:00:10 +02:00
parent 94eabf6220
commit ac29faf3bb
+2 -2
View File
@@ -998,8 +998,8 @@ struct UniformBuilder :public PassAttributeBuilder
// optimize common uniforms
if (uniformType == Uniform::SAMPLER_2D || uniformType == Uniform::INT)
{
int val;
uniform->get(val);
int val = 0;
uniform->get(val); // 'val' remains unchanged in case of error (Uniform is a non-scalar)
if (uniformType == Uniform::SAMPLER_2D && val == 0
&& name == "texture") {
uniform = texture0;