From 2eefb4972fc74a1bd2992292cec71d4b06852297 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Tue, 2 Nov 2021 09:11:25 -0400 Subject: [PATCH] * BugFix: Correct an ASAN memory access error in TSShapeEdit caused by reading a reference from the same vector we are pushing to at the same time. --- Engine/source/ts/tsShapeEdit.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Engine/source/ts/tsShapeEdit.cpp b/Engine/source/ts/tsShapeEdit.cpp index 6c5db7814..601b4ad87 100644 --- a/Engine/source/ts/tsShapeEdit.cpp +++ b/Engine/source/ts/tsShapeEdit.cpp @@ -1584,7 +1584,8 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, offset = srcShape->groundTranslations.size() - 1; } - groundTranslations.push_back(srcShape->groundTranslations[offset]); + const Point3F pointValueToCopy = srcShape->groundTranslations[offset]; + groundTranslations.push_back(pointValueToCopy); S32 offset2 = groundBase + i; if (offset2 >= srcShape->groundRotations.size()) @@ -1593,7 +1594,8 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, offset2 = srcShape->groundRotations.size() - 1; } - groundRotations.push_back(srcShape->groundRotations[offset2]); + const Quat16 quatValueToCopy = srcShape->groundRotations[offset2]; + groundRotations.push_back(quatValueToCopy); } // Add triggers