From 31170b11a0d20ca96be59471f1e313bfef6cd6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Li=C3=B1=C3=A1n?= Date: Tue, 17 Nov 2020 13:08:30 +0100 Subject: [PATCH] Fix frustum parameters not being initialized --- simgear/scene/viewer/Compositor.cxx | 3 ++- simgear/scene/viewer/CompositorPass.cxx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/simgear/scene/viewer/Compositor.cxx b/simgear/scene/viewer/Compositor.cxx index c229b49a..c4bdc88f 100644 --- a/simgear/scene/viewer/Compositor.cxx +++ b/simgear/scene/viewer/Compositor.cxx @@ -177,7 +177,8 @@ Compositor::update(const osg::Matrix &view_matrix, SGGeod camera_pos_geod = SGGeod::fromCart( SGVec3d(camera_pos.x(), camera_pos.y(), camera_pos.z())); - double left, right, bottom, top, zNear, zFar; + double left = 0.0, right = 0.0, bottom = 0.0, top = 0.0, + zNear = 0.0, zFar = 0.0; proj_matrix.getFrustum(left, right, bottom, top, zNear, zFar); osg::Matrixf prev_view_matrix, prev_view_matrix_inv; diff --git a/simgear/scene/viewer/CompositorPass.cxx b/simgear/scene/viewer/CompositorPass.cxx index d1d23303..9cdb2c35 100644 --- a/simgear/scene/viewer/CompositorPass.cxx +++ b/simgear/scene/viewer/CompositorPass.cxx @@ -502,7 +502,8 @@ public: // Calculate the light's point of view transformation matrices. // Taken from Project Rembrandt. - double left, right, bottom, top, zNear, zFar; + double left = 0.0, right = 0.0, bottom = 0.0, top = 0.0, + zNear = 0.0, zFar = 0.0; proj_matrix.getFrustum(left, right, bottom, top, zNear, zFar); osg::BoundingSphere bs;