From 5dba6726f7583a7cfb972296d0d52fb528f2be02 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 23 Jul 2021 18:14:33 -0400 Subject: [PATCH] glx/dri: Fix error generation for invalid GLX_RENDER_TYPE This needs to throw BadValue. Part-of: --- src/glx/dri2_glx.c | 6 ++++-- src/glx/dri3_glx.c | 6 ++++-- src/glx/drisw_glx.c | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 5ca15be07d3..633b0ba6e7b 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -168,8 +168,10 @@ dri2_create_context_attribs(struct glx_screen *base, goto error_exit; /* Check the renderType value */ - if (!validate_renderType_against_config(config_base, dca.render_type)) - goto error_exit; + if (!validate_renderType_against_config(config_base, dca.render_type)) { + *error = BadValue; + goto error_exit; + } if (shareList) { /* We can't share with an indirect context */ diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index bab21854e35..bd871e81193 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -219,8 +219,10 @@ dri3_create_context_attribs(struct glx_screen *base, goto error_exit; /* Check the renderType value */ - if (!validate_renderType_against_config(config_base, dca.render_type)) - goto error_exit; + if (!validate_renderType_against_config(config_base, dca.render_type)) { + *error = BadValue; + goto error_exit; + } if (shareList) { /* We can't share with an indirect context */ diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index cd004741f03..9b67a1a871f 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -576,7 +576,8 @@ drisw_create_context_attribs(struct glx_screen *base, /* Check the renderType value */ if (!validate_renderType_against_config(config_base, dca.render_type)) { - return NULL; + *error = BadValue; + return NULL; } if (shareList) {