summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-06-10 23:11:37 -0500
committerDave Parks <davep@lindenlab.com>2010-06-10 23:11:37 -0500
commitad5a45624a702433d481c3dbc0f348a8755b367c (patch)
tree3717a7390302f48d4cffa1237f08268cf679ae14 /indra
parenta7eadcccd02210349a07d10a52669f4678d8fae2 (diff)
Fix for unaligned LLVector4a causing crash in attachObject.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvoavatar.cpp17
-rw-r--r--indra/newview/llvoavatar.h2
2 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 05114c1ca4..63c2ce87ca 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -683,7 +683,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
{
LLMemType mt(LLMemType::MTYPE_AVATAR);
//VTResume(); // VTune
-
+ mImpostorExtents = (LLVector4a*) ll_aligned_malloc_16(32);
+
// mVoiceVisualizer is created by the hud effects manager and uses the HUD Effects pipeline
const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job
mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim );
@@ -829,6 +830,9 @@ LLVOAvatar::~LLVOAvatar()
mAnimationSources.clear();
+ ll_aligned_free_16(mImpostorExtents);
+ mImpostorExtents = NULL;
+
lldebugs << "LLVOAvatar Destructor end" << llendl;
}
@@ -5558,8 +5562,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi
// correctly, but putting this check in here to be safe.
if (attachmentID & ATTACHMENT_ADD)
{
- llwarns << "Got an attachment with ATTACHMENT_ADD mask, removing ( attach pt:" << attachmentID << " )" << llendl;
- attachmentID &= ~ATTACHMENT_ADD;
+ llwarns << "Got an attachment with ATTACHMENT_ADD mask, removing ( attach pt:" << attachmentID << " )" << llendl; attachmentID &= ~ATTACHMENT_ADD;
}
LLViewerJointAttachment* attachment = get_if_there(mAttachmentPoints, attachmentID, (LLViewerJointAttachment*)NULL);
@@ -5680,6 +5683,14 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object)
return TRUE;
}
}
+
+ std::vector<LLPointer<LLViewerObject> >::iterator iter = std::find(mPendingAttachment.begin(), mPendingAttachment.end(), viewer_object);
+ if (iter != mPendingAttachment.end())
+ {
+ mPendingAttachment.erase(iter);
+ return TRUE;
+ }
+
return FALSE;
}
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index b4da8ba5a4..358a1c256f 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -405,7 +405,7 @@ private:
LLVector3 mImpostorOffset;
LLVector2 mImpostorDim;
BOOL mNeedsAnimUpdate;
- LL_ALIGN_16(LLVector4a mImpostorExtents[2]);
+ LLVector4a* mImpostorExtents;
LLVector3 mImpostorAngle;
F32 mImpostorDistance;
F32 mImpostorPixelArea;