src/video/x11/SDL_x11opengl.c
changeset 5981 75caa8a7d559
parent 5630 39e74dab5ebb
child 6044 35448a5ea044
     1.1 --- a/src/video/x11/SDL_x11opengl.c	Wed Oct 12 20:01:09 2011 -0400
     1.2 +++ b/src/video/x11/SDL_x11opengl.c	Thu Oct 13 01:08:30 2011 -0400
     1.3 @@ -19,8 +19,8 @@
     1.4    3. This notice may not be removed or altered from any source distribution.
     1.5  */
     1.6  #include "SDL_config.h"
     1.7 -
     1.8  #include "SDL_x11video.h"
     1.9 +#include "SDL_assert.h"
    1.10  
    1.11  /* GLX implementation of SDL OpenGL support */
    1.12  
    1.13 @@ -388,8 +388,10 @@
    1.14      XVisualInfo *vinfo;
    1.15  
    1.16      /* 64 seems nice. */
    1.17 -    int attribs[64];
    1.18 -    int i = X11_GL_GetAttributes(_this,display,screen,attribs,64);
    1.19 +    const int max_attrs = 64;
    1.20 +    int attribs[max_attrs];
    1.21 +    const int i = X11_GL_GetAttributes(_this,display,screen,attribs,max_attrs);
    1.22 +    SDL_assert(i <= max_attrs);
    1.23  
    1.24      vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs);
    1.25      if (!vinfo) {