Pārlūkot izejas kodu

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.
tags/android-x86-2.2-r2
nobled pirms 15 gadiem
vecāks
revīzija
b5dc40710d
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6
    2
      src/glx/glxcmds.c

+ 6
- 2
src/glx/glxcmds.c Parādīt failu

@@ -215,12 +215,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;


Notiek ielāde…
Atcelt
Saglabāt