summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/include/state_tracker/st_api.h2
-rw-r--r--src/gallium/state_trackers/glx/xlib/glx_api.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index f95f65f1560..ec6e7844b87 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -202,7 +202,7 @@ struct st_visual
enum pipe_format color_format;
enum pipe_format depth_stencil_format;
enum pipe_format accum_format;
- int samples;
+ unsigned samples;
/**
* Desired render buffer.
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index c473a0fe541..1994e6823a8 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