forked from enlightenment/efl
evas - evas_gl - fix shader patch to not free static strings
parsing problem with opengl_strtok() which would free the previous token "p", but in some cases it would be a const string. this should fix CID 1039653
This commit is contained in:
parent
f0ba71314e
commit
f3d1db0fba
|
@ -2120,15 +2120,18 @@ do_eglShaderPatch(const char *source, int length, int *patched_len)
|
|||
{
|
||||
if (!strncmp(p, "gl_MaxVertexUniformVectors", 26))
|
||||
{
|
||||
p = "(gl_MaxVertexUniformComponents / 4)";
|
||||
free(p);
|
||||
p = strdup("(gl_MaxVertexUniformComponents / 4)");
|
||||
}
|
||||
else if (!strncmp(p, "gl_MaxFragmentUniformVectors", 28))
|
||||
{
|
||||
p = "(gl_MaxFragmentUniformComponents / 4)";
|
||||
free(p);
|
||||
p = strdup("(gl_MaxFragmentUniformComponents / 4)");
|
||||
}
|
||||
else if (!strncmp(p, "gl_MaxVaryingVectors", 20))
|
||||
{
|
||||
p = "(gl_MaxVaryingFloats / 4)";
|
||||
free(p);
|
||||
p = strdup("(gl_MaxVaryingFloats / 4)");
|
||||
}
|
||||
|
||||
int new_len = strlen(p);
|
||||
|
|
|
@ -3330,15 +3330,18 @@ patch_gles_shader(const char *source, int length, int *patched_len)
|
|||
{
|
||||
if (!strncmp(p, "gl_MaxVertexUniformVectors", 26))
|
||||
{
|
||||
p = "(gl_MaxVertexUniformComponents / 4)";
|
||||
free(p);
|
||||
p = strdup("(gl_MaxVertexUniformComponents / 4)");
|
||||
}
|
||||
else if (!strncmp(p, "gl_MaxFragmentUniformVectors", 28))
|
||||
{
|
||||
p = "(gl_MaxFragmentUniformComponents / 4)";
|
||||
free(p);
|
||||
p = strdup("(gl_MaxFragmentUniformComponents / 4)");
|
||||
}
|
||||
else if (!strncmp(p, "gl_MaxVaryingVectors", 20))
|
||||
{
|
||||
p = "(gl_MaxVaryingFloats / 4)";
|
||||
free(p);
|
||||
p = strdup("(gl_MaxVaryingFloats / 4)");
|
||||
}
|
||||
|
||||
int new_len = strlen(p);
|
||||
|
|
Loading…
Reference in New Issue