diff options
author | Simon Martin <simartin@users.sourceforge.net> | 2018-04-21 00:48:58 +0200 |
---|---|---|
committer | Simon Martin <simartin@users.sourceforge.net> | 2018-04-21 11:32:11 +0200 |
commit | f32ffeb5530aff5a93ea1d5405d5bd8456fcd8af (patch) | |
tree | 74385e6137ed25b12b487a321a275abfc08c73e6 /components/script/dom/webglrenderingcontext.rs | |
parent | 05fe8fa08d507836ce5659ff56f83022a90b241a (diff) | |
download | servo-f32ffeb5530aff5a93ea1d5405d5bd8456fcd8af.tar.gz servo-f32ffeb5530aff5a93ea1d5405d5bd8456fcd8af.zip |
Issue #20623: Check the input to WebGLRenderingContext's clear().
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 8e4757a5841..628f69e736b 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -1866,6 +1866,9 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { if !self.validate_framebuffer_complete() { return; } + if mask & !(constants::DEPTH_BUFFER_BIT | constants::STENCIL_BUFFER_BIT | constants::COLOR_BUFFER_BIT) != 0 { + return self.webgl_error(InvalidValue); + } self.send_command(WebGLCommand::Clear(mask)); self.mark_as_dirty(); |