glx: Be sure to set an error for ghost contexts

Otherwise the caller is going to return garbage memory for the error
value.

Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2018-05-07 17:21:19 -04:00
parent b9f415cbad
commit 9f21872ad8
1 changed files with 3 additions and 1 deletions

View File

@ -137,8 +137,10 @@ validGlxContext(ClientPtr client, XID id, int access_mode,
__GLXcontext ** context, int *err)
{
/* no ghost contexts */
if (id & SERVER_BIT)
if (id & SERVER_BIT) {
*err = __glXError(GLXBadContext);
return FALSE;
}
*err = dixLookupResourceByType((void **) context, id,
__glXContextRes, client, access_mode);