summaryrefslogtreecommitdiff
path: root/indra/newview/llvograss.cpp
diff options
context:
space:
mode:
authorsimon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com>2012-05-07 13:24:52 -0700
committersimon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com>2012-05-07 13:24:52 -0700
commit71bbb384b056476bbf1177d20b2ade16ca0a4bcf (patch)
treecf6c14b1886190f9ae723c065d43e3b243f82a72 /indra/newview/llvograss.cpp
parent68ec4d8355326f7c42c8e6fbabe774df6e5f41dd (diff)
MAINT-753 : [crashhunters] crash at LLVOVolume::updateFaceFlags(). Null pointer checks are good.
Reviewed by Kelly
Diffstat (limited to 'indra/newview/llvograss.cpp')
-rw-r--r--indra/newview/llvograss.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp
index be3558aad1..44968342bf 100644
--- a/indra/newview/llvograss.cpp
+++ b/indra/newview/llvograss.cpp
@@ -381,8 +381,10 @@ BOOL LLVOGrass::updateLOD()
{
mNumBlades <<= 1;
}
-
- face->setSize(mNumBlades*8, mNumBlades*12);
+ if (face)
+ {
+ face->setSize(mNumBlades*8, mNumBlades*12);
+ }
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
}
else if (num_blades <= (mNumBlades >> 1))
@@ -392,7 +394,10 @@ BOOL LLVOGrass::updateLOD()
mNumBlades >>=1;
}
- face->setSize(mNumBlades*8, mNumBlades*12);
+ if (face)
+ {
+ face->setSize(mNumBlades*8, mNumBlades*12);
+ }
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
return TRUE;
}
@@ -450,14 +455,16 @@ void LLVOGrass::plantBlades()
}
LLFace *face = mDrawable->getFace(0);
+ if (face)
+ {
+ face->setTexture(getTEImage(0));
+ face->setState(LLFace::GLOBAL);
+ face->setSize(mNumBlades * 8, mNumBlades * 12);
+ face->setVertexBuffer(NULL);
+ face->setTEOffset(0);
+ face->mCenterLocal = mPosition + mRegionp->getOriginAgent();
+ }
- face->setTexture(getTEImage(0));
- face->setState(LLFace::GLOBAL);
- face->setSize(mNumBlades * 8, mNumBlades * 12);
- face->setVertexBuffer(NULL);
- face->setTEOffset(0);
- face->mCenterLocal = mPosition + mRegionp->getOriginAgent();
-
mDepth = (face->mCenterLocal - LLViewerCamera::getInstance()->getOrigin())*LLViewerCamera::getInstance()->getAtAxis();
mDrawable->setPosition(face->mCenterLocal);
mDrawable->movePartition();
@@ -487,6 +494,8 @@ void LLVOGrass::getGeometry(S32 idx,
LLColor4U color(255,255,255,255);
LLFace *face = mDrawable->getFace(idx);
+ if (!face)
+ return;
F32 width = sSpeciesTable[mSpecies]->mBladeSizeX;
F32 height = sSpeciesTable[mSpecies]->mBladeSizeY;