Bug 1237420 - "Fix length-checking when setting WebGL 2 vertex attributes with an array". r=jgilbert

This commit is contained in:
Brad Kotsopoulos 2016-01-09 13:20:00 +01:00
parent 1ac727f9a5
commit 552f476047
2 changed files with 5 additions and 5 deletions

View File

@ -122,10 +122,10 @@ WebGL2Context::VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
void
WebGL2Context::VertexAttribI4iv(GLuint index, size_t length, const GLint* v)
{
if (!ValidateAttribIndex(index, "vertexAttribI4iv"))
if (!ValidateAttribArraySetter("vertexAttribI4iv", 4, length))
return;
if (!ValidateAttribArraySetter("vertexAttribI4iv", 4, length))
if (!ValidateAttribIndex(index, "vertexAttribI4iv"))
return;
mVertexAttribType[index] = LOCAL_GL_INT;
@ -183,7 +183,7 @@ WebGL2Context::VertexAttribI4uiv(GLuint index, size_t length, const GLuint* v)
if (IsContextLost())
return;
if (!ValidateAttribIndex(index, "vertexAttribI4uiv"))
if (!ValidateAttribArraySetter("vertexAttribI4uiv", 4, length))
return;
if (!ValidateAttribIndex(index, "vertexAttribI4uiv"))

View File

@ -448,8 +448,8 @@ WebGLContext::ValidateAttribArraySetter(const char* name, uint32_t setterElemSiz
return false;
if (arrayLength < setterElemSize) {
ErrorInvalidOperation("%s: Array must have >= %d elements.", name,
setterElemSize);
ErrorInvalidValue("%s: Array must have >= %d elements.", name,
setterElemSize);
return false;
}