glx/dri: Fix error generation for invalid GLX_RENDER_TYPE
authorAdam Jackson <ajax@redhat.com>
Fri, 23 Jul 2021 22:14:33 +0000 (18:14 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 21:29:54 +0000 (21:29 +0000)
This needs to throw BadValue.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12006>

src/glx/dri2_glx.c
src/glx/dri3_glx.c
src/glx/drisw_glx.c

index 5ca15be..633b0ba 100644 (file)
@@ -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 */
index bab2185..bd871e8 100644 (file)
@@ -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 */
index cd00474..9b67a1a 100644 (file)
@@ -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) {