mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 14:50:10 +01:00
glx: Don't allow glXMakeContextCurrent() with only one valid drawable
Drawable and readable need to either both be None or both be non-None. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
af6b7bf236
commit
d257ec0136
1 changed files with 7 additions and 0 deletions
|
|
@ -194,6 +194,13 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
|
|||
return True;
|
||||
}
|
||||
|
||||
/* can't have only one be 0 */
|
||||
if (!!draw != !!read) {
|
||||
__glXUnlock();
|
||||
__glXSendError(dpy, BadMatch, None, X_GLXMakeContextCurrent, True);
|
||||
return False;
|
||||
}
|
||||
|
||||
if (oldGC != &dummyContext) {
|
||||
if (--oldGC->thread_refcount == 0) {
|
||||
oldGC->vtable->unbind(oldGC, gc);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue