From c39b35eaf15e384c3c0492bebd03b1a0130649a1 Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Thu, 13 Nov 2025 01:30:41 +1000 Subject: Fix crash in updateDistance updating LOD on null mVObjp Signed-off-by: Hecklezz --- indra/newview/lldrawable.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview/lldrawable.cpp') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 9d212cfe8b..6f8fb34fb3 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -925,7 +925,10 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) LLVector3 cam_pos_from_agent = LLViewerCamera::getInstance()->getOrigin(); LLVector3 cam_to_box_offset = point_to_box_offset(cam_pos_from_agent, av_box); mDistanceWRTCamera = llmax(0.01f, ll_round(cam_to_box_offset.magVec(), 0.01f)); - mVObjp->updateLOD(); + if (mVObjp) + { + mVObjp->updateLOD(); + } return; } } @@ -936,7 +939,10 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update) pos -= camera.getOrigin(); mDistanceWRTCamera = ll_round(pos.magVec(), 0.01f); - mVObjp->updateLOD(); + if (mVObjp) + { + mVObjp->updateLOD(); + } } } -- cgit v1.3 From 4b78edbd1cd62b34f0b3f2b98ab4398437c6bc4d Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Thu, 13 Nov 2025 15:55:28 +1000 Subject: Follow-up null checks on mVObjp to prevent crashes Signed-off-by: Hecklezz --- indra/newview/lldrawable.cpp | 5 +++++ indra/newview/llface.h | 2 +- indra/newview/llviewerobject.cpp | 2 +- indra/newview/llvograss.cpp | 2 +- indra/newview/pipeline.cpp | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) (limited to 'indra/newview/lldrawable.cpp') diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 6f8fb34fb3..322ee90541 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -954,6 +954,11 @@ void LLDrawable::updateTexture() return; } + if (!mVObjp) + { + return; + } + if (getNumFaces() != mVObjp->getNumTEs()) { //drawable is transitioning its face count return; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 65637fbf85..db18f6643e 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -127,7 +127,7 @@ public: void setIndexInTex(U32 ch, S32 index) { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); mIndexInTex[ch] = index; } void setWorldMatrix(const LLMatrix4& mat); - const LLTextureEntry* getTextureEntry() const { return mVObjp->getTE(mTEOffset); } + const LLTextureEntry* getTextureEntry() const { return mVObjp ? mVObjp->getTE(mTEOffset) : nullptr; } LLFacePool* getPool() const { return mDrawPoolp; } U32 getPoolType() const { return mPoolType; } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index ed4856df11..59bcad9a26 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -7235,7 +7235,7 @@ void LLAlphaObject::getBlendFunc(S32 face, LLRender::eBlendFactor& src, LLRender void LLStaticViewerObject::updateDrawable(bool force_damped) { // Force an immediate rebuild on any update - if (mDrawable.notNull()) + if (mDrawable.notNull() && mDrawable->getVObj()) { mDrawable->updateXform(true); gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index fdd39a0e30..86d08b8658 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -736,7 +736,7 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) void LLVOGrass::updateDrawable(bool force_damped) { // Force an immediate rebuild on any update - if (mDrawable.notNull()) + if (mDrawable.notNull() && mDrawable->getVObj()) { mDrawable->updateXform(true); gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7f30baa66c..0aa6ffb335 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2955,7 +2955,7 @@ void LLPipeline::markMoved(LLDrawable *drawablep, bool damped_motion) void LLPipeline::markShift(LLDrawable *drawablep) { - if (!drawablep || drawablep->isDead()) + if (!drawablep || drawablep->isDead() || !drawablep->getVObj()) { return; } @@ -2989,7 +2989,7 @@ void LLPipeline::shiftObjects(const LLVector3 &offset) iter != mShiftList.end(); iter++) { LLDrawable *drawablep = *iter; - if (drawablep->isDead()) + if (drawablep->isDead() || !drawablep->getVObj()) { continue; } -- cgit v1.3