Commit 8a8ad1cc authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Avoid a memcpy() in IWineD3DImpl_FillGLCaps().

And associated stack buffer.
parent d9b463af
......@@ -2336,22 +2336,20 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter)
while (*GL_Extensions)
{
const char *start;
char current_ext[256];
while (isspace(*GL_Extensions)) ++GL_Extensions;
start = GL_Extensions;
while (!isspace(*GL_Extensions) && *GL_Extensions) ++GL_Extensions;
len = GL_Extensions - start;
if (!len || len >= sizeof(current_ext)) continue;
if (!len) continue;
memcpy(current_ext, start, len);
current_ext[len] = '\0';
TRACE_(d3d_caps)("- %s\n", debugstr_a(current_ext));
TRACE_(d3d_caps)("- %s\n", debugstr_an(start, len));
for (i = 0; i < (sizeof(EXTENSION_MAP) / sizeof(*EXTENSION_MAP)); ++i)
{
if (!strcmp(current_ext, EXTENSION_MAP[i].extension_string))
if (len == strlen(EXTENSION_MAP[i].extension_string)
&& !memcmp(start, EXTENSION_MAP[i].extension_string, len))
{
TRACE_(d3d_caps)(" FOUND: %s support.\n", EXTENSION_MAP[i].extension_string);
gl_info->supported[EXTENSION_MAP[i].extension] = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment