diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 360a41e651..3bbd79d457 100755
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -616,6 +616,14 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
{
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
+ // Crash fix due to invalid calls to drawElements by Drake Arconis
+ if (num_indices <= 0)
+ {
+ LL_WARNS() << "Called drawElements with 0 indices" << LL_ENDL;
+ return;
+ }
+ //
+
gGL.syncMatrices();
U32 mask = LLVertexBuffer::MAP_VERTEX;
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index f909305e1d..cfac7c04bf 100755
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2514,7 +2514,10 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
}
}
- if (phys_volume->mHullPoints)
+ // Crash fix due to invalid calls to drawElements by Drake Arconis
+ //if (phys_volume->mHullPoints)
+ if (phys_volume->mHullPoints && phys_volume->mHullIndices && phys_volume->mNumHullPoints > 0 && phys_volume->mNumHullIndices > 0)
+ //
{
//render hull