X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-scene-loader%2Fpublic-api%2Fgltf2-loader.cpp;h=451060b807a19820e08107b680fd1442957b66cc;hp=ed08a4106c8ffc09684cc6597e35e468c58d62c4;hb=4b8ce75c615d3ebb84de69224a6210d3fd7cdea1;hpb=7a315fe9869206bf6ad3195931f27d88fe9c128e diff --git a/dali-scene-loader/public-api/gltf2-loader.cpp b/dali-scene-loader/public-api/gltf2-loader.cpp index ed08a41..451060b 100644 --- a/dali-scene-loader/public-api/gltf2-loader.cpp +++ b/dali-scene-loader/public-api/gltf2-loader.cpp @@ -903,13 +903,15 @@ float LoadBlendShapeKeyFrames(const std::string& path, const gt::Animation::Chan const float duration = LoadDataFromAccessors(path, input, output, inputDataBuffer, outputDataBuffer); char weightNameBuffer[32]; - char* const pWeightName = weightNameBuffer + sprintf(weightNameBuffer, "%s[", BLEND_SHAPE_WEIGHTS_UNIFORM.c_str()); + auto prefixSize = snprintf(weightNameBuffer, sizeof(weightNameBuffer), "%s[", BLEND_SHAPE_WEIGHTS_UNIFORM.c_str()); + char* const pWeightName = weightNameBuffer + prefixSize; + const auto remainingSize = sizeof(weightNameBuffer) - prefixSize; for (uint32_t weightIndex = 0u, endWeightIndex = channel.mSampler->mOutput->mCount / channel.mSampler->mInput->mCount; weightIndex < endWeightIndex; ++weightIndex) { AnimatedProperty& animatedProperty = properties[propertyIndex++]; animatedProperty.mNodeName = nodeName; - sprintf(pWeightName, "%d]", weightIndex); + snprintf(pWeightName, remainingSize, "%d]", weightIndex); animatedProperty.mPropertyName = std::string(weightNameBuffer); animatedProperty.mKeyFrames = KeyFrames::New();