From b056f6d7f7f33542177cc2c118743e2a8950e925 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 8 Jul 2010 12:56:22 -0500 Subject: EXT-8236 Massage code around crash in ~LLSpatialGroup -- looks like heap corruption. --- indra/newview/llspatialpartition.cpp | 1 + indra/newview/llspatialpartition.h | 2 -- indra/newview/pipeline.cpp | 2 +- indra/newview/pipeline.h | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index d6e9256fee..86faeeaa73 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -300,6 +300,7 @@ LLSpatialGroup::~LLSpatialGroup() } delete [] mOcclusionVerts; + mOcclusionVerts = NULL; LLMemType mt(LLMemType::MTYPE_SPACE_PARTITION); clearDrawMap(); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 7896488379..48070cc438 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -164,8 +164,6 @@ public: static BOOL sNoDelete; //deletion of spatial groups and draw info not allowed if TRUE typedef std::vector > sg_vector_t; - typedef std::set > sg_set_t; - typedef std::list > sg_list_t; typedef std::vector > bridge_list_t; typedef std::vector > drawmap_elem_t; typedef std::map draw_map_t; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3716a5e9d9..14688e4506 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1794,7 +1794,7 @@ void LLPipeline::rebuildPriorityGroups() assertInitialized(); // Iterate through all drawables on the priority build queue, - for (LLSpatialGroup::sg_list_t::iterator iter = mGroupQ1.begin(); + for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ1.begin(); iter != mGroupQ1.end(); ++iter) { LLSpatialGroup* group = *iter; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 89649a0682..862bfc2f30 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -584,7 +584,7 @@ protected: // LLDrawable::drawable_list_t mBuildQ1; // priority LLDrawable::drawable_list_t mBuildQ2; // non-priority - LLSpatialGroup::sg_list_t mGroupQ1; //priority + LLSpatialGroup::sg_vector_t mGroupQ1; //priority LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority LLViewerObject::vobj_list_t mCreateQ; -- cgit v1.2.3 From 3d9413377638886ca2c6616f13be18beac00ebeb Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 8 Jul 2010 15:14:23 -0500 Subject: EXT-8287 Add some null checks and asserts around drawable faces. --- indra/newview/lldrawable.h | 16 ++++++++++++++-- indra/newview/llface.h | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index 651dabff9e..08972853c3 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -313,8 +313,20 @@ private: inline LLFace* LLDrawable::getFace(const S32 i) const { - llassert((U32)i < mFaces.size()); - llassert(mFaces[i]); + //switch these asserts to llerrs -- davep + //llassert((U32)i < mFaces.size()); + //llassert(mFaces[i]); + + if ((U32) i >= mFaces.size()) + { + llerrs << "Invalid face index." << llendl; + } + + if (!mFaces[i]) + { + llerrs << "Null face found." << llendl; + } + return mFaces[i]; } diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 67dd97e6f7..de533a6864 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -279,7 +279,7 @@ public: { bool operator()(const LLFace* const& lhs, const LLFace* const& rhs) { - return lhs->mDistance > rhs->mDistance; // farthest = first + return !lhs || (rhs && (lhs->mDistance > rhs->mDistance)); // farthest = first } }; -- cgit v1.2.3