diff options
author | Adam Jackson <ajax@redhat.com> | 2020-03-05 16:32:56 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2020-03-30 17:32:22 -0400 |
commit | 1e29f3ea3eb63cfcb78a463ee0345ec22a013033 (patch) | |
tree | 34b28c72f7e88b1f96f205100c48019c3f9ca50b /glx | |
parent | b56e501092169a9c0a60663d832ee71898a8bc4b (diff) |
glx: Require screens match for share contexts for classic CreateContext
The GLX_ARB_create_context path (with which this should all get unified,
someday, sigh) already enforces this, but the classic path does not.
It's effectively assumed by the implementation anyway, so let's enforce
it rather than do crashy things.
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glx')
-rw-r--r-- | glx/glxcmds.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 189b5d913..1e2061d89 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -284,6 +284,15 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, */ isDirect = GL_FALSE; } + + /* Core GLX doesn't explicitly require this, but GLX_ARB_create_context + * does (see glx/createcontext.c), and it's assumed by our + * implementation anyway, so let's be consistent about it. + */ + if (shareglxc->pGlxScreen != pGlxScreen) { + client->errorValue = shareglxc->pGlxScreen->pScreen->myNum; + return BadMatch; + } } /* |