From 391411b660eafe2f6c8c3844f36dbe438c34201c Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 25 Sep 2019 13:49:11 -0700 Subject: [PATCH] fix use of uninitialized variable --- examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 3c2b11bd9..62a0e3ac7 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -7999,10 +7999,12 @@ bool PhysicsServerCommandProcessor::processLoadSoftBodyCommand(const struct Shar } const std::string& error_message_prefix = ""; std::string out_found_filename; - int out_type; + int out_type=0; bool foundFile = UrdfFindMeshFile(fileIO, pathPrefix, relativeFileName, error_message_prefix, &out_found_filename, &out_type); btSoftBody* psb = NULL; + if (foundFile) + { btScalar spring_elastic_stiffness, spring_damping_stiffness; if (out_type == UrdfGeometry::FILE_OBJ) { @@ -8063,6 +8065,7 @@ bool PhysicsServerCommandProcessor::processLoadSoftBodyCommand(const struct Shar m_data->m_dynamicsWorld->addForce(psb, new btDeformableMassSpringForce(spring_elastic_stiffness, spring_damping_stiffness, true)); } #endif + } } if (psb != NULL) {