egl: fix invalid flag detection for EGL_KHR_create_context
authorMatt Turner <mattst88@gmail.com>
Fri, 24 Aug 2012 23:26:54 +0000 (16:26 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 27 Aug 2012 22:11:11 +0000 (15:11 -0700)
We want to check whether there are bits set outside of the valid flags.

Fixes piglit test egl-create-context-invalid-flag-gl

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/egl/main/eglcontext.c

index 829050d14757a656c65db04d34d28ba417963fd4..71eca6f896113624e4c1157c23d7e75247926097 100644 (file)
@@ -341,7 +341,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
       break;
    }
 
-   if ((ctx->Flags & (EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR
+   if ((ctx->Flags & ~(EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR
                       | EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR
                       | EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR)) != 0) {
       err = EGL_BAD_ATTRIBUTE;