[Xquartz-changes] xserver: Branch 'master'
Jeremy Huddleston
jeremyhu at freedesktop.org
Sun Apr 22 20:54:02 PDT 2012
glx/glapi_gentable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 4d958f9ecd5f75858eba63afd8d9523824e1bf21
Author: Jonas Maebe <jonas.maebe at elis.ugent.be>
Date: Sun Apr 22 20:52:47 2012 -0700
glapi: Correct size of allocated _glapi_table struct
The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct
as an array of _glapi_get_dispatch_table_size() pointers, so we have to
allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather than
sizeof(struct _glapi_struct) bytes.
Signed-off-by: Jonas Maebe <jonas.maebe at elis.ugent.be>
Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
diff --git a/glx/glapi_gentable.c b/glx/glapi_gentable.c
index 1fb1431..4b28015 100644
--- a/glx/glapi_gentable.c
+++ b/glx/glapi_gentable.c
@@ -113,7 +113,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp)
struct _glapi_table *
_glapi_create_table_from_handle(void *handle, const char *symbol_prefix)
{
- struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table));
+ struct _glapi_table *disp = calloc(_glapi_get_dispatch_table_size(), sizeof(void*));
char symboln[512];
if (!disp)
More information about the Xquartz-changes
mailing list