From 9053b9020a380f95f23051ca123127519db53e29 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 26 Sep 2013 11:03:04 -0600 Subject: fix for SH-4521: Interesting viewer crash in Pipeline:RenderDrawPools --- indra/llmath/lltreenode.h | 9 ++++++++- indra/newview/llvieweroctree.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/indra/llmath/lltreenode.h b/indra/llmath/lltreenode.h index c66bc26176..0b479c4564 100755 --- a/indra/llmath/lltreenode.h +++ b/indra/llmath/lltreenode.h @@ -57,7 +57,14 @@ public: virtual bool remove(T* data); virtual void notifyRemoval(T* data); virtual U32 getListenerCount() { return mListeners.size(); } - virtual LLTreeListener* getListener(U32 index) const { return mListeners[index]; } + virtual LLTreeListener* getListener(U32 index) const + { + if(index < mListeners.size()) + { + return mListeners[index]; + } + return NULL; + } virtual void addListener(LLTreeListener* listener) { mListeners.push_back(listener); } protected: diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 47033afea3..e1684c19df 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -957,7 +957,7 @@ public: { LLOcclusionCullingGroup* group = (LLOcclusionCullingGroup*) n->getListener(0); - if (group->isOcclusionState(mState)) + if (group && group->isOcclusionState(mState)) { OctreeTraveler::traverse(n); } -- cgit v1.2.3