From c1c2830f9b7bf4d91977133ffbcd8d0240bcc7fe 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') 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