From 1fc1b7f67928082b9e922463be25c232d9bcba6a Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 5 Apr 2011 16:01:05 +0000 Subject: Solved crash due to null pointer access --- xorg-server/hw/xwin/glx/indirect.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xorg-server/hw/xwin') diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c index b73200569..4a795fde8 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -74,6 +74,8 @@ #include #include #include +#include +#include #include #include @@ -103,6 +105,7 @@ struct __GLXWinContext { __GLXWinContext *shareContext; /* Context with which we will share display lists and textures */ HWND hwnd; /* For detecting when HWND has changed */ HWND hreadwnd; + struct _glapi_table *Dispatch; }; struct __GLXWinDrawable @@ -1715,6 +1718,7 @@ glxWinContextDestroy(__GLXcontext *base) gc->ctx = NULL; } + free(gc->Dispatch); free(gc); } } @@ -1750,6 +1754,9 @@ glxWinCreateContext(__GLXscreen *screen, // actual native GL context creation is deferred until attach() //context->ctx = NULL; already done with memset context->shareContext = shareContext; + + context->Dispatch=calloc(sizeof(void*), (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS)); + _glapi_set_dispatch(context->Dispatch); glWinSetupDispatchTable(); -- cgit v1.2.3