Mesa (8.0): glapi: Correct size of allocated _glapi_table struct
Jeremy Huddleston
jeremyhu at kemper.freedesktop.org
Mon Apr 23 03:41:08 UTC 2012
Module: Mesa
Branch: 8.0
Commit: bb30e76328e9dd80b0c7a7688828e3cf8e662b1b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bb30e76328e9dd80b0c7a7688828e3cf8e662b1b
Author: Jonas Maebe <jonas.maebe at elis.ugent.be>
Date: Sun Apr 22 20:39:32 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.
Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
(cherry picked from commit 8d09f4d0cc8d2ac5398c8b26638d5659429a4280)
---
src/mapi/glapi/glapi_gentable.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/mapi/glapi/glapi_gentable.c b/src/mapi/glapi/glapi_gentable.c
index 5c04801..640c495 100644
--- a/src/mapi/glapi/glapi_gentable.c
+++ b/src/mapi/glapi/glapi_gentable.c
@@ -105,7 +105,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 mesa-commit
mailing list