diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-04-20 21:44:34 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-04-20 21:56:21 +0300 |
commit | 278853824d5da452f66f7dc4cc8858884f53505d (patch) | |
tree | afc0393eee48bca63f657a1eb72795daf739a999 /indra | |
parent | 7a311fe30ee3c4a4de0149822b0670f612eb4a67 (diff) |
Fixed merge conflict and restored SL-1130
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llrender.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index c3345c5c16..4e7c71a374 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1539,8 +1539,15 @@ void LLRender::matrixMode(eMatrixMode mode) { U32 tex_index = gGL.getCurrentTexUnitIndex(); // the shaders don't actually reference anything beyond texture_matrix0/1 outside of terrain rendering - llassert_always(tex_index <= 3); + llassert(tex_index <= 3); mode = eMatrixMode(MM_TEXTURE0 + gGL.getCurrentTexUnitIndex()); + if (mode > MM_TEXTURE3) + { + // getCurrentTexUnitIndex() can go as high as 32 (LL_NUM_TEXTURE_LAYERS) + // Large value will result in a crash at mMatrix + LL_WARNS_ONCE() << "Attempted to assign matrix mode out of bounds: " << mode << LL_ENDL; + mode = MM_TEXTURE0; + } } mMatrixMode = mode; |