diff options
author | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-05-07 13:24:52 -0700 |
---|---|---|
committer | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2012-05-07 13:24:52 -0700 |
commit | 71bbb384b056476bbf1177d20b2ade16ca0a4bcf (patch) | |
tree | cf6c14b1886190f9ae723c065d43e3b243f82a72 /indra/newview/llviewerobject.cpp | |
parent | 68ec4d8355326f7c42c8e6fbabe774df6e5f41dd (diff) |
MAINT-753 : [crashhunters] crash at LLVOVolume::updateFaceFlags(). Null pointer checks are good.
Reviewed by Kelly
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r-- | indra/newview/llviewerobject.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e590f29a9a..1aa541793f 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -432,7 +432,9 @@ void LLViewerObject::dump() const llinfos << "PositionAgent: " << getPositionAgent() << llendl; llinfos << "PositionGlobal: " << getPositionGlobal() << llendl; llinfos << "Velocity: " << getVelocity() << llendl; - if (mDrawable.notNull() && mDrawable->getNumFaces()) + if (mDrawable.notNull() && + mDrawable->getNumFaces() && + mDrawable->getFace(0)) { LLFacePool *poolp = mDrawable->getFace(0)->getPool(); if (poolp) @@ -4467,7 +4469,11 @@ U32 LLViewerObject::getNumVertices() const num_faces = mDrawable->getNumFaces(); for (i = 0; i < num_faces; i++) { - num_vertices += mDrawable->getFace(i)->getGeomCount(); + LLFace * facep = mDrawable->getFace(i); + if (facep) + { + num_vertices += facep->getGeomCount(); + } } } return num_vertices; @@ -4482,7 +4488,11 @@ U32 LLViewerObject::getNumIndices() const num_faces = mDrawable->getNumFaces(); for (i = 0; i < num_faces; i++) { - num_indices += mDrawable->getFace(i)->getIndicesCount(); + LLFace * facep = mDrawable->getFace(i); + if (facep) + { + num_indices += facep->getIndicesCount(); + } } } return num_indices; |