From: ThorstenB Date: Sun, 25 Mar 2012 13:11:50 +0000 (+0200) Subject: osg::Uniform::get does not return a value on error. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ac29faf3bb6a250a918c3f9af20236c1b588fc22;p=simgear.git osg::Uniform::get does not return a value on error. Fixes "usage of uninitialized data" errors reported by valgrind. --- diff --git a/simgear/scene/material/Effect.cxx b/simgear/scene/material/Effect.cxx index a3064fdf..16458407 100644 --- a/simgear/scene/material/Effect.cxx +++ b/simgear/scene/material/Effect.cxx @@ -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;