浏览代码

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 15 年前
父节点
当前提交
b5dc40710d
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6
    2
      src/glx/glxcmds.c

+ 6
- 2
src/glx/glxcmds.c 查看文件

Bool allowDirect, Bool allowDirect,
unsigned code, int renderType, int screen) 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; struct glx_context *shareList = (struct glx_context *) shareList_user;
if (dpy == NULL) if (dpy == NULL)
return NULL; return NULL;


psc = GetGLXScreenConfigs(dpy, screen);
if (psc == NULL)
return NULL;

if (generic_id == None) if (generic_id == None)
return NULL; return NULL;



正在加载...
取消
保存