summaryrefslogtreecommitdiffstats
path: root/src/egl/main/egldisplay.h
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-08-19 13:00:25 +0800
committerBrian Paul <[email protected]>2009-08-21 08:34:34 -0600
commit408db29792a2d57409f2604974e4398a3545a38f (patch)
treed15a071c83e216b8d799f99912c307936f20f1cd /src/egl/main/egldisplay.h
parent9b3e5df900db465319ed4b5d4c4721e1986fb5a3 (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.h')
-rw-r--r--src/egl/main/egldisplay.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 6394c9cedba..20651e51ffd 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -125,14 +125,17 @@ _eglCheckSurfaceHandle(EGLSurface surf, _EGLDisplay *dpy);
/* Only do a quick check. This is NOT standard compliant. */
static INLINE EGLBoolean
-_eglCheckDisplayHandle(EGLDisplay dpy) { return EGL_TRUE; }
+_eglCheckDisplayHandle(EGLDisplay dpy)
+{
+ return ((_EGLDisplay *) dpy != NULL);
+}
static INLINE EGLBoolean
_eglCheckContextHandle(EGLContext ctx, _EGLDisplay *dpy)
{
_EGLContext *c = (_EGLContext *) ctx;
- return (c && c->Display == dpy);
+ return (dpy && c && c->Display == dpy);
}
@@ -140,7 +143,7 @@ static INLINE EGLBoolean
_eglCheckSurfaceHandle(EGLSurface surf, _EGLDisplay *dpy)
{
_EGLSurface *s = (_EGLSurface *) surf;
- return (s && s->Display == dpy);
+ return (dpy && s && s->Display == dpy);
}