From 166c525eb3e19936db7993e9555cc0b4e6f8408d Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 6 Jul 2022 13:41:48 +0100 Subject: [PATCH] Fix the SVACE error for facial animation loader Change-Id: Id98a169cbf79496944335ca1723f79f7c4c6012d --- .../public-api/facial-animation-loader.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dali-scene-loader/public-api/facial-animation-loader.cpp b/dali-scene-loader/public-api/facial-animation-loader.cpp index 3209467a60..6c92d6a3ec 100644 --- a/dali-scene-loader/public-api/facial-animation-loader.cpp +++ b/dali-scene-loader/public-api/facial-animation-loader.cpp @@ -18,6 +18,9 @@ // FILE HEADER #include +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include #include @@ -135,9 +138,7 @@ AnimationDefinition LoadFacialAnimation(const std::string& url) } // Set the property names - char weightNameBuffer[32]; - char* const pWeightName = weightNameBuffer + sprintf(weightNameBuffer, "%s", BlendShapes::WEIGHTS_UNIFORM.c_str()); - uint32_t targets = 0u; + uint32_t targets = 0u; for(const auto& blendShape : facialAnimation.mBlendShapes) { for(uint32_t morphTargetIndex = 0u; morphTargetIndex < blendShape.mNumberOfMorphTarget; ++morphTargetIndex) @@ -147,8 +148,9 @@ AnimationDefinition LoadFacialAnimation(const std::string& url) animatedProperty.mNodeName = blendShape.mNodeName; - snprintf(pWeightName, sizeof(weightNameBuffer) - (pWeightName - weightNameBuffer), "[%d]", morphTargetIndex); - animatedProperty.mPropertyName = weightNameBuffer; + std::stringstream weightPropertyStream; + weightPropertyStream << BlendShapes::WEIGHTS_UNIFORM << "[" << morphTargetIndex << "]"; + animatedProperty.mPropertyName = weightPropertyStream.str(); } targets += blendShape.mNumberOfMorphTarget; } -- 2.34.1