From 3b3ff53eb53db023462eba0283ef7586e79df35a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 11 Jun 2021 21:16:08 +0300 Subject: SL-15391 Crash at getUniformLocation --- indra/llrender/llglslshader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 0e4753fcc6..08c9dd8769 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -1436,7 +1436,11 @@ GLint LLGLSLShader::getUniformLocation(U32 index) GLint ret = -1; if (mProgramObject) { - llassert(index < mUniform.size()); + if (index >= mUniform.size()) + { + LL_WARNS_ONCE("Shader") << "Uniform index " << index << " out of bounds " << (S32)mUniform.size() << LL_ENDL; + return ret; + } return mUniform[index]; } -- cgit v1.2.3