From: Brian Paul Date: Tue, 13 Jun 2006 23:04:41 +0000 (+0000) Subject: GLX_BAD_CONTEXT checks in video-sync functions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d087480b4b1207c058efcccc9a72faedcea4651;p=mesa.git GLX_BAD_CONTEXT checks in video-sync functions --- diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 7ce607a69c0..4f3dca8f484 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -588,8 +588,8 @@ glXGetVideoSyncSGI(unsigned int *count) struct _glxapi_table *t; Display *dpy = glXGetCurrentDisplay(); GET_DISPATCH(dpy, t); - if (!t) - return 0; + if (!t || !glXGetCurrentContext()) + return GLX_BAD_CONTEXT; return (t->GetVideoSyncSGI)(count); } @@ -599,8 +599,8 @@ glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) struct _glxapi_table *t; Display *dpy = glXGetCurrentDisplay(); GET_DISPATCH(dpy, t); - if (!t) - return 0; + if (!t || !glXGetCurrentContext()) + return GLX_BAD_CONTEXT; return (t->WaitVideoSyncSGI)(divisor, remainder, count); } @@ -614,7 +614,7 @@ glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXConte struct _glxapi_table *t; GET_DISPATCH(dpy, t); if (!t) - return 0; + return False; return (t->MakeCurrentReadSGI)(dpy, draw, read, ctx); }