mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1237420 - "Fix length-checking when setting WebGL 2 vertex attributes with an array". r=jgilbert
This commit is contained in:
parent
1ac727f9a5
commit
552f476047
@ -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"))
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user