From 42f7b6d2e43e114685af3e9bf9c286f4b6e63f92 Mon Sep 17 00:00:00 2001 From: E Spause Date: Sun, 20 Dec 2020 09:52:03 -0500 Subject: [PATCH] EMotionFX crash when used with replication Fixes an uninitialized variable in an EmotionFX component. (m_animGraphInstance) This variable will cause a crash, especially in a replicated situation where Activate is not called on this component - as it doesn't use a weak pointer container. m_animGraphInstance needs to be set to null before being used - otherwise, the pointer will be considered valid memory as it's set to a non-null, garbage memory value by default. --- .../Code/Source/Integration/Components/AnimGraphComponent.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp b/dev/Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp index 8fd717cfe7..7638948bb7 100644 --- a/dev/Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp +++ b/dev/Gems/EMotionFX/Code/Source/Integration/Components/AnimGraphComponent.cpp @@ -173,6 +173,7 @@ namespace EMotionFX ////////////////////////////////////////////////////////////////////////// AnimGraphComponent::AnimGraphComponent(const Configuration* config) { + m_animGraphInstance.reset(); if (config) { m_configuration = *config;