Browse Source

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

Jorrit Rouwe 3 years ago
parent
commit
50cda0ceba
1 changed files with 2 additions and 0 deletions
  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);