From 2eed9ff2fb5b218b7b274d2989b0dbbe5fcfedef Mon Sep 17 00:00:00 2001 From: Tomasz Lis Date: Thu, 18 Jul 2013 14:19:38 -0700 Subject: glx: Validate the GLX_RENDER_TYPE value Correctly handle the value of renderType in GLX context. In case of the value being incorrect, context creation fails. v2 (idr): indirect_create_context is just a memory allocator, so don't validate the GLX_RENDER_TYPE there. Fixes regressions in several GLX_ARB_create_context piglit tests. Signed-off-by: Tomasz Lis Signed-off-by: Ian Romanick Reviewed-by: Ian Romanick --- src/glx/drisw_glx.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/glx/drisw_glx.c') diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 2c3e8b5..0583cd1 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -380,6 +380,10 @@ drisw_create_context(struct glx_screen *base, if (!psc->base.driScreen) return NULL; + /* Check the renderType value */ + if (!validate_renderType_against_config(config_base, renderType)) + return NULL; + if (shareList) { /* If the shareList context is not a DRISW context, we cannot possibly * create a DRISW context that shares it. @@ -451,6 +455,11 @@ drisw_create_context_attribs(struct glx_screen *base, &api, &reset, error)) return NULL; + /* Check the renderType value */ + if (!validate_renderType_against_config(config_base, renderType)) { + return NULL; + } + if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) return NULL; -- cgit v1.1