Explorar el Código

Merge branch 'master' of github.com:jrouwe/JoltPhysics

Jorrit Rouwe hace 3 años
padre
commit
50cda0ceba
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      Jolt/Physics/Collision/Shape/CompoundShape.cpp

+ 2 - 0
Jolt/Physics/Collision/Shape/CompoundShape.cpp

@@ -132,6 +132,8 @@ uint32 CompoundShape::GetSubShapeUserData(const SubShapeID &inSubShapeID) const
 	// Decode sub shape index
 	SubShapeID remainder;
 	uint32 index = GetSubShapeIndexFromID(inSubShapeID, remainder);
+	if (index >= mSubShapes.size())
+		return 0; // No longer valid index
 
 	// Pass call on
 	return mSubShapes[index].mShape->GetSubShapeUserData(remainder);