Issue #20623: Check the input to WebGLRenderingContext's clear().

This commit is contained in:
Simon Martin 2018-04-21 00:48:58 +02:00
parent 05fe8fa08d
commit f32ffeb553
3 changed files with 36 additions and 0 deletions

View file

@ -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();