Crash fix due to invalid calls to drawElements by Drake Arconis

meow-7.2.2
Ansariel 2015-07-17 12:08:09 +02:00
parent 286430cf15
commit d2c3f41e1e
2 changed files with 12 additions and 1 deletions

View File

@ -616,6 +616,14 @@ void LLVertexBuffer::drawElements(U32 mode, const LLVector4a* pos, const LLVecto
{
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
// <FS:Ansariel> 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;
}
// </FS:Ansariel>
gGL.syncMatrices();
U32 mask = LLVertexBuffer::MAP_VERTEX;

View File

@ -2514,7 +2514,10 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume)
}
}
if (phys_volume->mHullPoints)
// <FS:Ansariel> 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)
// </FS:Ansariel>
{
//render hull