diff options
Diffstat (limited to 'linden/indra/llcharacter/llkeyframemotion.cpp')
-rw-r--r-- | linden/indra/llcharacter/llkeyframemotion.cpp | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/linden/indra/llcharacter/llkeyframemotion.cpp b/linden/indra/llcharacter/llkeyframemotion.cpp index 212020b..4b138b1 100644 --- a/linden/indra/llcharacter/llkeyframemotion.cpp +++ b/linden/indra/llcharacter/llkeyframemotion.cpp | |||
@@ -1560,6 +1560,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1560 | } | 1560 | } |
1561 | constraintp->mChainLength = (S32) byte; | 1561 | constraintp->mChainLength = (S32) byte; |
1562 | 1562 | ||
1563 | if((U32)constraintp->mChainLength > mJointMotionList->getNumJointMotions()) | ||
1564 | { | ||
1565 | llwarns << "invalid constraint chain length" << llendl; | ||
1566 | delete constraintp; | ||
1567 | return FALSE; | ||
1568 | } | ||
1569 | |||
1563 | if (!dp.unpackU8(byte, "constraint_type")) | 1570 | if (!dp.unpackU8(byte, "constraint_type")) |
1564 | { | 1571 | { |
1565 | llwarns << "can't read constraint type" << llendl; | 1572 | llwarns << "can't read constraint type" << llendl; |
@@ -1587,7 +1594,14 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1587 | delete constraintp; | 1594 | delete constraintp; |
1588 | return FALSE; | 1595 | return FALSE; |
1589 | } | 1596 | } |
1590 | 1597 | ||
1598 | if( !(constraintp->mSourceConstraintOffset.isFinite()) ) | ||
1599 | { | ||
1600 | llwarns << "non-finite constraint source offset" << llendl; | ||
1601 | delete constraintp; | ||
1602 | return FALSE; | ||
1603 | } | ||
1604 | |||
1591 | if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "target_volume")) | 1605 | if (!dp.unpackBinaryDataFixed(bin_data, BIN_DATA_LENGTH, "target_volume")) |
1592 | { | 1606 | { |
1593 | llwarns << "can't read target volume name" << llendl; | 1607 | llwarns << "can't read target volume name" << llendl; |
@@ -1615,6 +1629,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1615 | return FALSE; | 1629 | return FALSE; |
1616 | } | 1630 | } |
1617 | 1631 | ||
1632 | if( !(constraintp->mTargetConstraintOffset.isFinite()) ) | ||
1633 | { | ||
1634 | llwarns << "non-finite constraint target offset" << llendl; | ||
1635 | delete constraintp; | ||
1636 | return FALSE; | ||
1637 | } | ||
1638 | |||
1618 | if (!dp.unpackVector3(constraintp->mTargetConstraintDir, "target_dir")) | 1639 | if (!dp.unpackVector3(constraintp->mTargetConstraintDir, "target_dir")) |
1619 | { | 1640 | { |
1620 | llwarns << "can't read constraint target direction" << llendl; | 1641 | llwarns << "can't read constraint target direction" << llendl; |
@@ -1622,6 +1643,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1622 | return FALSE; | 1643 | return FALSE; |
1623 | } | 1644 | } |
1624 | 1645 | ||
1646 | if( !(constraintp->mTargetConstraintDir.isFinite()) ) | ||
1647 | { | ||
1648 | llwarns << "non-finite constraint target direction" << llendl; | ||
1649 | delete constraintp; | ||
1650 | return FALSE; | ||
1651 | } | ||
1652 | |||
1625 | if (!constraintp->mTargetConstraintDir.isExactlyZero()) | 1653 | if (!constraintp->mTargetConstraintDir.isExactlyZero()) |
1626 | { | 1654 | { |
1627 | constraintp->mUseTargetOffset = TRUE; | 1655 | constraintp->mUseTargetOffset = TRUE; |
@@ -1685,8 +1713,13 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1685 | break; | 1713 | break; |
1686 | } | 1714 | } |
1687 | } | 1715 | } |
1716 | if (constraintp->mJointStateIndices[i] < 0 ) | ||
1717 | { | ||
1718 | llwarns << "No joint index for constraint " << i << llendl; | ||
1719 | delete constraintp; | ||
1720 | return FALSE; | ||
1721 | } | ||
1688 | } | 1722 | } |
1689 | |||
1690 | } | 1723 | } |
1691 | } | 1724 | } |
1692 | 1725 | ||