diff options
author | Chia-I Wu <[email protected]> | 2009-08-19 13:00:25 +0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-08-21 08:34:34 -0600 |
commit | 408db29792a2d57409f2604974e4398a3545a38f (patch) | |
tree | d15a071c83e216b8d799f99912c307936f20f1cd /src/egl/main/egldisplay.c | |
parent | 9b3e5df900db465319ed4b5d4c4721e1986fb5a3 (diff) |
egl: Check for null display in handle checking.
The display may be NULL when checking a handle.
Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/egl/main/egldisplay.c')
-rw-r--r-- | src/egl/main/egldisplay.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 30a49a25ae0..9b4227f5458 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -305,9 +305,10 @@ _eglCheckDisplayHandle(EGLDisplay dpy) EGLBoolean _eglCheckContextHandle(EGLContext ctx, _EGLDisplay *dpy) { - _EGLContext *cur; + _EGLContext *cur = NULL; - cur = dpy->ContextList; + if (dpy) + cur = dpy->ContextList; while (cur) { if (cur == (_EGLContext *) ctx) { assert(cur->Display == dpy); @@ -325,9 +326,10 @@ _eglCheckContextHandle(EGLContext ctx, _EGLDisplay *dpy) EGLBoolean _eglCheckSurfaceHandle(EGLSurface surf, _EGLDisplay *dpy) { - _EGLSurface *cur; + _EGLSurface *cur = NULL; - cur = dpy->SurfaceList; + if (dpy) + cur = dpy->SurfaceList; while (cur) { if (cur == (_EGLSurface *) surf) { assert(cur->Display == dpy); |