aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglrenderingcontext.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2018-03-20 14:23:34 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2018-03-22 18:51:58 +0100
commit2a9c2bc8fd4a09e2e25b44d0e7296b49676c7f33 (patch)
treec4207e09a89c8f09c3221ca2aedcada1c63c2ce1 /components/script/dom/webglrenderingcontext.rs
parent4aaac61a87f4e45e46d0591be73ce108e562c33f (diff)
downloadservo-2a9c2bc8fd4a09e2e25b44d0e7296b49676c7f33.tar.gz
servo-2a9c2bc8fd4a09e2e25b44d0e7296b49676c7f33.zip
Fix an off-by-one error with limits.max_vertex_attribs
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r--components/script/dom/webglrenderingcontext.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index ad572751607..7cab80a22f1 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -471,7 +471,7 @@ impl WebGLRenderingContext {
}
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);
}
@@ -2223,7 +2223,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
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);
}
@@ -2232,7 +2232,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
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);
}
@@ -3238,7 +3238,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn VertexAttribPointer(&self, attrib_id: u32, size: i32, data_type: u32,
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);
}