Bug 1189860 - Check if the passed in shader attributes exceeds the maximum. r=jrmuizel

CLOSED TREE
This commit is contained in:
Kyle 2015-08-05 14:29:16 -04:00
parent e59ea46aed
commit f9ad578c0d

View File

@ -671,6 +671,12 @@ bool ProgramBinary::linkAttributes(InfoLog &infoLog, const AttributeBindings &at
unsigned int usedLocations = 0;
const std::vector<sh::Attribute> &shaderAttributes = vertexShader->getActiveAttributes();
if (shaderAttributes.size() > gl::MAX_VERTEX_ATTRIBS)
{
infoLog.append("%u vertex attributes passed in exceeds maximum of %u.", shaderAttributes.size(), gl::MAX_VERTEX_ATTRIBS);
return false;
}
// Link attributes that have a binding location
for (unsigned int attributeIndex = 0; attributeIndex < shaderAttributes.size(); attributeIndex++)
{