From 5876f3c85a61d73bb4863331bd641152a40a7b0c Mon Sep 17 00:00:00 2001 From: Tapani Pälli Date: Thu, 20 Oct 2016 14:11:16 +0300 Subject: egl: add check that eglCreateContext gets a valid config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following dEQP test: dEQP-EGL.functional.negative_api.create_context v2: don't break EGL_KHR_no_config_context (Eric Engestrom) Signed-off-by: Tapani Pälli Reviewed-by: Emil Velikov Reviewed-by: Eric Engestrom Cc: "12.0 13.0" --- src/egl/main/eglapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/egl/main/eglapi.c') diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index d8bd76dd12c..9db9964beee 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -734,7 +734,9 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, _EGL_CHECK_DISPLAY(disp, EGL_NO_CONTEXT, drv); - if (!config && !disp->Extensions.KHR_no_config_context) + if (config != EGL_NO_CONFIG_KHR) + _EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT, drv); + else if (!disp->Extensions.KHR_no_config_context) RETURN_EGL_ERROR(disp, EGL_BAD_CONFIG, EGL_NO_CONTEXT); if (!share && share_list != EGL_NO_CONTEXT) -- cgit v1.2.3