summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Maebe <jonas.maebe@elis.ugent.be>2012-04-22 20:52:47 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2012-04-26 21:07:09 -0700
commite4dbdee392c78de13fab03c3826f9453f42a8a46 (patch)
tree0c0105b6b60b33f83d777eca8d58949bb8e48109
parent6b45dff0240729a78a43cc74f1631b2dd5a0d6b3 (diff)
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@elis.ugent.be> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> (cherry picked from commit adcb48a29dcb3f32ff570551de4b014775c1e147)
-rw-r--r--glx/glapi_gentable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glx/glapi_gentable.c b/glx/glapi_gentable.c
index 1fb143100..4b2801547 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)