summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorGert Wollny <gw.fossdev@gmail.com>2018-01-18 09:57:26 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2018-01-19 15:45:57 +0000
commitd0e37599ab822b54ca231b7f155f92156854681d (patch)
tree6271791495c83dcc08ae905cfec81e8b5bb3e91b /src/gallium/state_trackers
parent7a2c87177ada941259bf35a982e67bfea0dd1d26 (diff)
gallium: Make (num_)samples an unsigned int
According to the ARB_multisample num_samples is a non-negative integer. Consequently define it as such, fail in glx/choose_visual if a negative number is given. v2: split patch into gallium and mesa part Signed-off-by: Gert Wollny <gw.fossdev@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/glx/xlib/glx_api.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index c473a0fe54..1994e6823a 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -181,7 +181,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
GLint depth_size, GLint stencil_size,
GLint accumRedSize, GLint accumGreenSize,
GLint accumBlueSize, GLint accumAlphaSize,
- GLint level, GLint numAuxBuffers, GLint num_samples )
+ GLint level, GLint numAuxBuffers, GLuint num_samples )
{
GLboolean ximageFlag = GL_TRUE;
XMesaVisual xmvis;
@@ -996,6 +996,10 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig )
(void) caveat;
+ if (num_samples < 0) {
+ _mesa_warning(NULL, "GLX_SAMPLES_ARB: number of samples must not be negative");
+ return NULL;
+ }
/*
* Since we're only simulating the GLX extension this function will never