diff -ru --exclude='.*' --exclude='*.o' --exclude='*.so*' --exclude=depend.bak Mesa-6.5.orig/src/glx/x11/glxclient.h Mesa-6.5/src/glx/x11/glxclient.h --- Mesa-6.5.orig/src/glx/x11/glxclient.h 2005-10-10 21:15:43.000000000 +0200 +++ Mesa-6.5/src/glx/x11/glxclient.h 2006-06-28 23:47:40.000000000 +0200 @@ -471,7 +471,7 @@ * libGL. */ /*@{*/ - unsigned char direct_support[8]; + unsigned char direct_support[ __GLX_EXT_BYTES ]; GLboolean ext_list_first_time; /*@}*/ diff -ru --exclude='.*' --exclude='*.o' --exclude='*.so*' --exclude=depend.bak Mesa-6.5.orig/src/glx/x11/glxextensions.c Mesa-6.5/src/glx/x11/glxextensions.c --- Mesa-6.5.orig/src/glx/x11/glxextensions.c 2006-03-31 19:29:46.000000000 +0200 +++ Mesa-6.5/src/glx/x11/glxextensions.c 2006-06-29 00:08:04.000000000 +0200 @@ -28,6 +28,7 @@ * \author Ian Romanick */ +#include #include "glxclient.h" #include #include @@ -253,9 +254,9 @@ /* global bit-fields of available extensions and their characteristics */ -static unsigned char client_glx_support[8]; -static unsigned char client_glx_only[8]; -static unsigned char direct_glx_only[8]; +static unsigned char client_glx_support[ __GLX_EXT_BYTES ]; +static unsigned char client_glx_only[ __GLX_EXT_BYTES ]; +static unsigned char direct_glx_only[ __GLX_EXT_BYTES ]; static unsigned char client_gl_support[ __GL_EXT_BYTES ]; static unsigned char client_gl_only[ __GL_EXT_BYTES ]; @@ -263,7 +264,7 @@ * Bits representing the set of extensions that are enabled by default in all * direct rendering drivers. */ -static unsigned char direct_glx_support[8]; +static unsigned char direct_glx_support[ __GLX_EXT_BYTES ]; /** * Highest core GL version that can be supported for indirect rendering. @@ -328,7 +329,7 @@ unsigned base; unsigned len; - (void) memset( server_support, 0, sizeof( server_support ) ); + (void) memset( server_support, 0, __GLX_EXT_BYTES ); for ( base = 0 ; server_string[ base ] != NUL ; /* empty */ ) { /* Determine the length of the next extension name. @@ -404,6 +405,8 @@ (void) memset( client_gl_only, 0, sizeof( client_gl_only ) ); for ( i = 0 ; known_glx_extensions[i].name != NULL ; i++ ) { + /* Just in case */ + assert ( i < __NUM_GLX_MAX_EXTS ); const unsigned bit = known_glx_extensions[i].bit; if ( known_glx_extensions[i].client_support ) { @@ -574,8 +577,8 @@ GLboolean display_is_direct_capable, int minor_version ) { - unsigned char server_support[8]; - unsigned char usable[8]; + unsigned char server_support[ __GLX_EXT_BYTES ]; + unsigned char usable[ __GLX_EXT_BYTES ]; unsigned i; __glXExtensionsCtr(); diff -ru --exclude='.*' --exclude='*.o' --exclude='*.so*' --exclude=depend.bak Mesa-6.5.orig/src/glx/x11/glxextensions.h Mesa-6.5/src/glx/x11/glxextensions.h --- Mesa-6.5.orig/src/glx/x11/glxextensions.h 2006-02-26 17:56:48.000000000 +0100 +++ Mesa-6.5/src/glx/x11/glxextensions.h 2006-06-28 23:39:46.000000000 +0200 @@ -230,8 +230,15 @@ GL_SUN_multi_draw_arrays_bit = GL_EXT_multi_draw_arrays_bit }; + #define __GL_EXT_BYTES ((__NUM_GL_EXTS + 7) / 8) +/* Define maximal amount of GLX extensions and number of bytes + * capable store flag about presence/absence of every one. */ +#define __NUM_GLX_MAX_EXTS 64 +#define __GLX_EXT_BYTES ((__NUM_GLX_MAX_EXTS + 7) / 8) + + struct __GLXscreenConfigsRec; struct __GLXcontextRec;