mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Fixed love.graphics.newShader crashing when extern variables with very short names are used
This commit is contained in:
@@ -219,8 +219,12 @@ void Shader::mapActiveUniforms()
|
|||||||
delete[] cname;
|
delete[] cname;
|
||||||
|
|
||||||
// glGetActiveUniform appends "[0]" to the end of array uniform names...
|
// glGetActiveUniform appends "[0]" to the end of array uniform names...
|
||||||
if (u.name.find("[0]") == u.name.length() - 3)
|
if (u.name.length() > 3)
|
||||||
u.name.erase(u.name.length() - 3);
|
{
|
||||||
|
size_t findpos = u.name.find("[0]");
|
||||||
|
if (findpos != std::string::npos && findpos == u.name.length() - 3)
|
||||||
|
u.name.erase(u.name.length() - 3);
|
||||||
|
}
|
||||||
|
|
||||||
if (u.location != -1)
|
if (u.location != -1)
|
||||||
uniforms[u.name] = u;
|
uniforms[u.name] = u;
|
||||||
|
|||||||
Reference in New Issue
Block a user