egl: Check for null display in handle checking.
The display may be NULL when checking a handle. Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
This commit is contained in:
@@ -305,8 +305,9 @@ _eglCheckDisplayHandle(EGLDisplay dpy)
|
|||||||
EGLBoolean
|
EGLBoolean
|
||||||
_eglCheckContextHandle(EGLContext ctx, _EGLDisplay *dpy)
|
_eglCheckContextHandle(EGLContext ctx, _EGLDisplay *dpy)
|
||||||
{
|
{
|
||||||
_EGLContext *cur;
|
_EGLContext *cur = NULL;
|
||||||
|
|
||||||
|
if (dpy)
|
||||||
cur = dpy->ContextList;
|
cur = dpy->ContextList;
|
||||||
while (cur) {
|
while (cur) {
|
||||||
if (cur == (_EGLContext *) ctx) {
|
if (cur == (_EGLContext *) ctx) {
|
||||||
@@ -325,8 +326,9 @@ _eglCheckContextHandle(EGLContext ctx, _EGLDisplay *dpy)
|
|||||||
EGLBoolean
|
EGLBoolean
|
||||||
_eglCheckSurfaceHandle(EGLSurface surf, _EGLDisplay *dpy)
|
_eglCheckSurfaceHandle(EGLSurface surf, _EGLDisplay *dpy)
|
||||||
{
|
{
|
||||||
_EGLSurface *cur;
|
_EGLSurface *cur = NULL;
|
||||||
|
|
||||||
|
if (dpy)
|
||||||
cur = dpy->SurfaceList;
|
cur = dpy->SurfaceList;
|
||||||
while (cur) {
|
while (cur) {
|
||||||
if (cur == (_EGLSurface *) surf) {
|
if (cur == (_EGLSurface *) surf) {
|
||||||
|
@@ -125,14 +125,17 @@ _eglCheckSurfaceHandle(EGLSurface surf, _EGLDisplay *dpy);
|
|||||||
/* Only do a quick check. This is NOT standard compliant. */
|
/* Only do a quick check. This is NOT standard compliant. */
|
||||||
|
|
||||||
static INLINE EGLBoolean
|
static INLINE EGLBoolean
|
||||||
_eglCheckDisplayHandle(EGLDisplay dpy) { return EGL_TRUE; }
|
_eglCheckDisplayHandle(EGLDisplay dpy)
|
||||||
|
{
|
||||||
|
return ((_EGLDisplay *) dpy != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static INLINE EGLBoolean
|
static INLINE EGLBoolean
|
||||||
_eglCheckContextHandle(EGLContext ctx, _EGLDisplay *dpy)
|
_eglCheckContextHandle(EGLContext ctx, _EGLDisplay *dpy)
|
||||||
{
|
{
|
||||||
_EGLContext *c = (_EGLContext *) ctx;
|
_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)
|
_eglCheckSurfaceHandle(EGLSurface surf, _EGLDisplay *dpy)
|
||||||
{
|
{
|
||||||
_EGLSurface *s = (_EGLSurface *) surf;
|
_EGLSurface *s = (_EGLSurface *) surf;
|
||||||
return (s && s->Display == dpy);
|
return (dpy && s && s->Display == dpy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user