* clutter/cogl/common/cogl-mesh.c:

Re-works validate_custom_attribute_name() so it doesn't access an
	un-initialised variable.
This commit is contained in:
Robert Bragg 2008-11-18 16:24:31 +00:00
parent 39aa5c27b5
commit 2705547469
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2008-11-18 Robert Bragg <robert@linux.intel.com>
* clutter/cogl/common/cogl-mesh.c:
Re-works validate_custom_attribute_name() so it doesn't access an
un-initialised variable.
2008-11-18 Robert Bragg <robert@linux.intel.com>
A comparison of gl/cogl-texture.c and gles/cogl-texture.c, to reduce
@ -32,7 +38,7 @@
submitting vertices, it uses vertex arrays like GLES and this gives
a small but measurable fps improvement for test-text.
2008-11-17 Robert Bragg <robert@linux.intel.com>
2008-11-18 Robert Bragg <robert@linux.intel.com>
* clutter/cogl/gl/cogl-internal.h
* clutter/cogl/gles/cogl-internal.h:

View File

@ -300,7 +300,6 @@ validate_custom_attribute_name (const char *attribute_name)
{
char *detail_seperator = NULL;
int name_len;
const char *p;
int i;
detail_seperator = strstr (attribute_name, "::");
@ -309,11 +308,13 @@ validate_custom_attribute_name (const char *attribute_name)
else
name_len = strlen (attribute_name);
if (name_len == 0 || !g_ascii_isalpha (*p) || *p != '_')
if (name_len == 0
|| !g_ascii_isalpha (attribute_name[0])
|| attribute_name[0] != '_')
return FALSE;
for (i = 1; i < name_len; i++)
if (!g_ascii_isalnum (*p) || *p != '_')
if (!g_ascii_isalnum (attribute_name[i]) || attribute_name[i] != '_')
return FALSE;
return TRUE;