From d2291b59035edbbec4a151b73c65e83d8a61ffb3 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 18 Apr 2011 01:44:13 -0500 Subject: [PATCH 1/2] Clamping prim settext max visible range to that of a 15^3 prim, because certain 'people' abuse megaprims to make annoying hovertext spam. --- indra/newview/llhudtext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index cdec1ec3e..efe73f52d 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -809,13 +809,14 @@ void LLHUDText::updateVisibility() return; } - if (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= LLViewerCamera::getInstance()->getNear() + 0.1f + mSourceObject->getVObjRadius()) + F32 object_radius = llmin(mSourceObject->getVObjRadius(), 26.f); //~15x15x15 prim : sqrt((15^2) * 3) = 25.9807621. getVObjRadius is diam. + if (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= LLViewerCamera::getInstance()->getNear() + 0.1f + object_radius) { mPositionAgent = LLViewerCamera::getInstance()->getOrigin() + vec_from_camera * ((LLViewerCamera::getInstance()->getNear() + 0.1f) / (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis())); } else { - mPositionAgent -= dir_from_camera * mSourceObject->getVObjRadius(); + mPositionAgent -= dir_from_camera * object_radius; } mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec(); From d3c91698bf7c02af3210d4893fe7b57572860bec Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 21 Apr 2011 00:17:10 -0500 Subject: [PATCH 2/2] Removed crash vulnerability to malevolently malformed notecards. --- indra/llinventory/llnotecard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llinventory/llnotecard.cpp b/indra/llinventory/llnotecard.cpp index 9e7e04376..c112d18d2 100644 --- a/indra/llinventory/llnotecard.cpp +++ b/indra/llinventory/llnotecard.cpp @@ -203,7 +203,7 @@ bool LLNotecard::importStream(std::istream& str) return FALSE; } - if(text_len > mMaxText) + if(text_len < 0 || text_len > mMaxText) { llwarns << "Invalid Linden text length: " << text_len << llendl; return FALSE;