diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2017-03-13 16:38:00 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2017-03-13 16:38:00 -0400 |
commit | 66de0c9965ff68bcb8cb60975fcffa45e2c6d74c (patch) | |
tree | e3fa6c87fe70e487b6fc6e94f6793b7638b568ea /indra/llrender/llrender.cpp | |
parent | 49e114748fdb52599aaa141c2006198c48aa083b (diff) | |
parent | 17c8eadb3d89bc78019f0b50eb8b109f25616781 (diff) |
Automated merge with ssh://bitbucket.org/lindenlab/viewer-release
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r-- | indra/llrender/llrender.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 3e7c69611d..77c5921c9c 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -2046,7 +2046,8 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, S32 vert_count) } } - mVerticesp[mCount] = mVerticesp[mCount-1]; + if( mCount > 0 ) // ND: Guard against crashes if mCount is zero, yes it can happen + mVerticesp[mCount] = mVerticesp[mCount-1]; } void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 vert_count) @@ -2162,9 +2163,12 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLCol } } - mVerticesp[mCount] = mVerticesp[mCount-1]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; - mColorsp[mCount] = mColorsp[mCount-1]; + if (mCount > 0) + { + mVerticesp[mCount] = mVerticesp[mCount - 1]; + mTexcoordsp[mCount] = mTexcoordsp[mCount - 1]; + mColorsp[mCount] = mColorsp[mCount - 1]; + } } void LLRender::vertex2i(const GLint& x, const GLint& y) |