Prevent use of reserved names in BindAttribLocation

This commit is contained in:
David Zbarsky 2016-04-16 12:05:59 -07:00
parent b00c2740e3
commit a67a744057
3 changed files with 11 additions and 8 deletions

View file

@ -147,7 +147,7 @@ impl WebGLProgram {
}
// Check if the name is reserved
if name.starts_with("webgl") || name.starts_with("_webgl_") {
if name.starts_with("gl_") || name.starts_with("webgl") || name.starts_with("_webgl_") {
return Err(WebGLError::InvalidOperation);
}
@ -185,6 +185,10 @@ impl WebGLProgram {
}
// Check if the name is reserved
if name.starts_with("gl_") {
return Err(WebGLError::InvalidOperation);
}
if name.starts_with("webgl") || name.starts_with("_webgl_") {
return Ok(None);
}