Skip to content
Snippets Groups Projects
Commit a7734451 authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

SL-10471 - animation validation for constraints

parent a3b3ad72
No related branches found
No related tags found
No related merge requests found
...@@ -1350,7 +1350,7 @@ LLVector3 LLAvatarAppearance::getVolumePos(S32 joint_index, LLVector3& volume_of ...@@ -1350,7 +1350,7 @@ LLVector3 LLAvatarAppearance::getVolumePos(S32 joint_index, LLVector3& volume_of
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id) LLJoint* LLAvatarAppearance::findCollisionVolume(U32 volume_id)
{ {
if ((S32)volume_id > mNumCollisionVolumes) if (((S32)volume_id >= mNumCollisionVolumes) || ((S32)volume_id < 0))
{ {
return NULL; return NULL;
} }
......
...@@ -1772,6 +1772,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id) ...@@ -1772,6 +1772,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id)
bin_data[BIN_DATA_LENGTH] = 0; // Ensure null termination bin_data[BIN_DATA_LENGTH] = 0; // Ensure null termination
str = (char*)bin_data; str = (char*)bin_data;
constraintp->mSourceConstraintVolume = mCharacter->getCollisionVolumeID(str); constraintp->mSourceConstraintVolume = mCharacter->getCollisionVolumeID(str);
if (constraintp->mSourceConstraintVolume == -1)
{
LL_WARNS() << "not a valid source constraint volume " << str
<< " for animation " << asset_id << LL_ENDL;
delete constraintp;
return FALSE;
}
if (!dp.unpackVector3(constraintp->mSourceConstraintOffset, "source_offset")) if (!dp.unpackVector3(constraintp->mSourceConstraintOffset, "source_offset"))
{ {
...@@ -1808,6 +1815,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id) ...@@ -1808,6 +1815,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id)
{ {
constraintp->mConstraintTargetType = CONSTRAINT_TARGET_TYPE_BODY; constraintp->mConstraintTargetType = CONSTRAINT_TARGET_TYPE_BODY;
constraintp->mTargetConstraintVolume = mCharacter->getCollisionVolumeID(str); constraintp->mTargetConstraintVolume = mCharacter->getCollisionVolumeID(str);
if (constraintp->mTargetConstraintVolume == -1)
{
LL_WARNS() << "not a valid target constraint volume " << str
<< " for animation " << asset_id << LL_ENDL;
delete constraintp;
return FALSE;
}
} }
if (!dp.unpackVector3(constraintp->mTargetConstraintOffset, "target_offset")) if (!dp.unpackVector3(constraintp->mTargetConstraintOffset, "target_offset"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment