From 8c8a7fa0c932fa6b1d642d6365bfaf011f28f7a8 Mon Sep 17 00:00:00 2001 From: Andreas Christiansen Date: Tue, 9 Jul 2019 11:52:42 +0200 Subject: [PATCH] Fix memory sanitizer warning on potential reading of uninitialized memory. This can happen for the RGB values that are only conditionally set in TinyRendererVisualShapeConverter::addVisualShape. --- examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 985b9c64e..1983b5b13 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -7470,6 +7470,14 @@ bool PhysicsServerCommandProcessor::processLoadSoftBodyCommand(const struct Shar visualShape.m_localVisualFrame[4] = initialOrn[1]; visualShape.m_localVisualFrame[5] = initialOrn[2]; visualShape.m_localVisualFrame[6] = initialOrn[3]; + //color and ids to be set by the renderer + visualShape.m_rgbaColor[0] = 0; + visualShape.m_rgbaColor[1] = 0; + visualShape.m_rgbaColor[2] = 0; + visualShape.m_rgbaColor[3] = 0; + visualShape.m_tinyRendererTextureId = -1; + visualShape.m_textureUniqueId =-1; + visualShape.m_openglTextureId = -1; m_data->m_pluginManager.getRenderInterface()->addVisualShape(&visualShape, fileIO);