mirror of
https://github.com/servo/servo.git
synced 2025-07-01 20:43:39 +01:00
Fix an off-by-one error with limits.max_vertex_attribs
This commit is contained in:
parent
4aaac61a87
commit
2a9c2bc8fd
1 changed files with 4 additions and 4 deletions
|
@ -471,7 +471,7 @@ impl WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn vertex_attrib(&self, indx: u32, x: f32, y: f32, z: f32, w: f32) {
|
fn vertex_attrib(&self, indx: u32, x: f32, y: f32, z: f32, w: f32) {
|
||||||
if indx > self.limits.max_vertex_attribs {
|
if indx >= self.limits.max_vertex_attribs {
|
||||||
return self.webgl_error(InvalidValue);
|
return self.webgl_error(InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2223,7 +2223,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn EnableVertexAttribArray(&self, attrib_id: u32) {
|
fn EnableVertexAttribArray(&self, attrib_id: u32) {
|
||||||
if attrib_id > self.limits.max_vertex_attribs {
|
if attrib_id >= self.limits.max_vertex_attribs {
|
||||||
return self.webgl_error(InvalidValue);
|
return self.webgl_error(InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2232,7 +2232,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn DisableVertexAttribArray(&self, attrib_id: u32) {
|
fn DisableVertexAttribArray(&self, attrib_id: u32) {
|
||||||
if attrib_id > self.limits.max_vertex_attribs {
|
if attrib_id >= self.limits.max_vertex_attribs {
|
||||||
return self.webgl_error(InvalidValue);
|
return self.webgl_error(InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3238,7 +3238,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttribPointer(&self, attrib_id: u32, size: i32, data_type: u32,
|
fn VertexAttribPointer(&self, attrib_id: u32, size: i32, data_type: u32,
|
||||||
normalized: bool, stride: i32, offset: i64) {
|
normalized: bool, stride: i32, offset: i64) {
|
||||||
if attrib_id > self.limits.max_vertex_attribs {
|
if attrib_id >= self.limits.max_vertex_attribs {
|
||||||
return self.webgl_error(InvalidValue);
|
return self.webgl_error(InvalidValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue