mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
glx: Put null check before use
'dpy' was being checked for null *after* it was already used once.
Also add a null check for psc, and drop gc's redundant initialization.
(cherry picked from commit b5dc40710d)
This commit is contained in:
parent
bba05bc699
commit
d7d55ab841
1 changed files with 6 additions and 2 deletions
|
|
@ -214,12 +214,16 @@ CreateContext(Display * dpy, int generic_id,
|
|||
Bool allowDirect,
|
||||
unsigned code, int renderType, int screen)
|
||||
{
|
||||
struct glx_context *gc = NULL;
|
||||
struct glx_screen *const psc = GetGLXScreenConfigs(dpy, screen);
|
||||
struct glx_context *gc;
|
||||
struct glx_screen *psc;
|
||||
struct glx_context *shareList = (struct glx_context *) shareList_user;
|
||||
if (dpy == NULL)
|
||||
return NULL;
|
||||
|
||||
psc = GetGLXScreenConfigs(dpy, screen);
|
||||
if (psc == NULL)
|
||||
return NULL;
|
||||
|
||||
if (generic_id == None)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue