Module: Mesa Branch: main Commit: 5dba6726f7583a7cfb972296d0d52fb528f2be02 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5dba6726f7583a7cfb972296d0d52fb528f2be02
Author: Adam Jackson <[email protected]> Date: Fri Jul 23 18:14:33 2021 -0400 glx/dri: Fix error generation for invalid GLX_RENDER_TYPE This needs to throw BadValue. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006> --- 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) {
