mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 18:26:15 +00:00
b=623394; [webgl] don't allow non-ascii characters in GLSL source; r=bjacob
This commit is contained in:
parent
146f5d0b4d
commit
1549e9ac38
@ -3626,6 +3626,9 @@ WebGLContext::ShaderSource(nsIWebGLShader *sobj, const nsAString& source)
|
|||||||
if (!GetConcreteObjectAndGLName("shaderSource: shader", sobj, &shader, &shadername))
|
if (!GetConcreteObjectAndGLName("shaderSource: shader", sobj, &shader, &shadername))
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
|
if (!NS_IsAscii(nsPromiseFlatString(source).get()))
|
||||||
|
return ErrorInvalidValue("shaderSource: non-ascii characters found in source");
|
||||||
|
|
||||||
shader->SetSource(NS_LossyConvertUTF16toASCII(source));
|
shader->SetSource(NS_LossyConvertUTF16toASCII(source));
|
||||||
|
|
||||||
shader->SetNeedsTranslation();
|
shader->SetNeedsTranslation();
|
||||||
|
Loading…
Reference in New Issue
Block a user