From 22e33533de412582aead179b15c0f03d1e9397ec Mon Sep 17 00:00:00 2001 From: Beq Date: Sat, 6 Jun 2020 01:24:06 +0100 Subject: [PATCH] FIRE-29679 - fix crash on rezzing mesh as selected --- indra/newview/llface.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index d780afd596..0f78876c89 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -658,7 +658,13 @@ void renderFace(LLDrawable* drawable, LLFace *face) const LLVolumeFace& vol_face = volume->getVolumeFace(face->getTEOffset()); // Use a vbo for the static LLVertexBuffer::drawArray/Element functions; by Drake Arconis/Shyotl Kuhr //LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mPositions, NULL, vol_face.mNumIndices, vol_face.mIndices); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mNumVertices, vol_face.mPositions, NULL, vol_face.mNumIndices, vol_face.mIndices); + // FIRE-29679 trap empty calls that cause crashes when rezzing in OpenSim. + // LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mNumVertices, vol_face.mPositions, NULL, vol_face.mNumIndices, vol_face.mIndices); + if (vol_face.mNumIndices !=0 || vol_face.mNumVertices !=0) + { + LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mNumVertices, vol_face.mPositions, NULL, vol_face.mNumIndices, vol_face.mIndices); + } + // } } }