From bddbb3f9dd5f9a689e0b2ce7dbb8f39c34dbbc5d Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 25 Jan 2018 16:02:47 -0800 Subject: [PATCH] TinyRenderer color pick: fix out-of-bounds issue --- .../tinyRendererPlugin/TinyRendererVisualShapeConverter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/SharedMemory/plugins/tinyRendererPlugin/TinyRendererVisualShapeConverter.cpp b/examples/SharedMemory/plugins/tinyRendererPlugin/TinyRendererVisualShapeConverter.cpp index 8697f0b60..c399a2c65 100644 --- a/examples/SharedMemory/plugins/tinyRendererPlugin/TinyRendererVisualShapeConverter.cpp +++ b/examples/SharedMemory/plugins/tinyRendererPlugin/TinyRendererVisualShapeConverter.cpp @@ -590,6 +590,7 @@ void TinyRendererVisualShapeConverter::convertVisualShapes( int colorIndex = linkIndex;//colObj? colObj->getBroadphaseHandle()->getUid() & 3 : 0; if (colorIndex<0) colorIndex=0; + colorIndex &=3; btVector4 color; color = sColors[colorIndex]; float rgbaColor[4] = {color[0],color[1],color[2],color[3]};