summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2010-09-07 19:49:06 +0200
committerMichel Dänzer <[email protected]>2010-09-07 19:54:16 +0200
commit6a6e6d7b0a84e20f9754af02a575ae34081d310c (patch)
tree4d8e2fec5f27b8833b710f1e380bd36b85d44e0e /src
parent5afdfa222fa9ec8c54e7d6957d2680c37a9eb715 (diff)
Fix crashes when some GLX API entrypoints are called with no current context.
I was hitting this with gliv. The GLX spec explicitly mentions that glXWaitX, glXWaitGL and glXUseXFont calls are ignored when there's no current context. Not sure what if anything the GLX_EXT_texture_from_pixmap spec says about this, but I think ignoring the calls makes more sense than crashing there as well. :)
Diffstat (limited to 'src')
-rw-r--r--src/glx/glxcmds.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
index 7016fdf2a8d..d9e370c1997 100644
--- a/src/glx/glxcmds.c
+++ b/src/glx/glxcmds.c
@@ -481,7 +481,7 @@ glXWaitGL(void)
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc && gc->vtable->wait_gl)
+ if (gc && gc->vtable && gc->vtable->wait_gl)
gc->vtable->wait_gl(gc);
}
@@ -494,7 +494,7 @@ glXWaitX(void)
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc && gc->vtable->wait_x)
+ if (gc && gc->vtable && gc->vtable->wait_x)
gc->vtable->wait_x(gc);
}
@@ -503,7 +503,7 @@ glXUseXFont(Font font, int first, int count, int listBase)
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc && gc->vtable->use_x_font)
+ if (gc && gc->vtable && gc->vtable->use_x_font)
gc->vtable->use_x_font(gc, font, first, count, listBase);
}
@@ -2344,7 +2344,7 @@ __glXBindTexImageEXT(Display * dpy,
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc == NULL || gc->vtable->bind_tex_image == NULL)
+ if (gc == NULL || gc->vtable == NULL || gc->vtable->bind_tex_image == NULL)
return;
gc->vtable->bind_tex_image(dpy, drawable, buffer, attrib_list);
@@ -2355,7 +2355,7 @@ __glXReleaseTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer)
{
struct glx_context *gc = __glXGetCurrentContext();
- if (gc == NULL || gc->vtable->release_tex_image == NULL)
+ if (gc == NULL || gc->vtable == NULL || gc->vtable->release_tex_image == NULL)
return;
gc->vtable->release_tex_image(dpy, drawable, buffer);