Explorar o código

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

Jorrit Rouwe %!s(int64=3) %!d(string=hai) anos
pai
achega
50cda0ceba
Modificáronse 1 ficheiros con 2 adicións e 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);