aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/glx/indirect.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-04-05 16:01:05 +0000
committermarha <marha@users.sourceforge.net>2011-04-05 16:01:05 +0000
commit1fc1b7f67928082b9e922463be25c232d9bcba6a (patch)
tree94accc92f40d87a73b4575fee2db3937f19c2e3c /xorg-server/hw/xwin/glx/indirect.c
parent6254e74e8b2ff8a2a1e8476a3300a7bdd65b7ad6 (diff)
downloadvcxsrv-1fc1b7f67928082b9e922463be25c232d9bcba6a.tar.gz
vcxsrv-1fc1b7f67928082b9e922463be25c232d9bcba6a.tar.bz2
vcxsrv-1fc1b7f67928082b9e922463be25c232d9bcba6a.zip
Solved crash due to null pointer access
Diffstat (limited to 'xorg-server/hw/xwin/glx/indirect.c')
-rw-r--r--xorg-server/hw/xwin/glx/indirect.c7
1 files changed, 7 insertions, 0 deletions
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 <glx/glxutil.h>
#include <glx/extension_string.h>
#include <GL/glxtokens.h>
+#include <glx/glapitable.h>
+#include <glx/glapi.h>
#include <winpriv.h>
#include <wgl_ext_api.h>
@@ -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();