SL-15391 Crash at getUniformLocation

meow-7.2.2
Andrey Kleshchev 2021-06-11 21:16:08 +03:00 committed by Nat Goodspeed
parent 80ac5d49d9
commit 3b3ff53eb5
1 changed files with 5 additions and 1 deletions

View File

@ -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];
}