summaryrefslogtreecommitdiff
path: root/src/glx
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2006-07-13 15:27:37 +0000
committerIan Romanick <idr@us.ibm.com>2006-07-13 15:27:37 +0000
commit7ef4a07165d49e671f6f569ee87bfe893b1e7fcf (patch)
tree91bf26471c504057b651525dff39999f9ee17fa1 /src/glx
parent883f9891cb203dd087843b830ab058d6c9e160dc (diff)
Move initialization of server_support from __glXProcessServerString to
__glXCalcualteUsableExtensions. By having both callers of __glXProcessServerString initialize the bit-fields passed in, we guarantee that the correct amount of data is initialized: This fixes bugzilla #7353.
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/x11/glxextensions.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c
index c3bc93009a..d00bdbb250 100644
--- a/src/glx/x11/glxextensions.c
+++ b/src/glx/x11/glxextensions.c
@@ -319,6 +319,11 @@ set_glx_extension( const struct extension_info * ext,
*
* \param server_string GLX extension string from the server.
* \param server_support Bit-field of supported extensions.
+ *
+ * \note
+ * This function is used to process both GLX and GL extension strings. The
+ * bit-fields used to track each of these have different sizes. Therefore,
+ * the data pointed by \c server_support must be preinitialized to zero.
*/
static void
__glXProcessServerString( const struct extension_info * ext,
@@ -328,8 +333,6 @@ __glXProcessServerString( const struct extension_info * ext,
unsigned base;
unsigned len;
- (void) memset( server_support, 0, sizeof( server_support ) );
-
for ( base = 0 ; server_string[ base ] != NUL ; /* empty */ ) {
/* Determine the length of the next extension name.
*/
@@ -580,6 +583,8 @@ __glXCalculateUsableExtensions( __GLXscreenConfigs *psc,
__glXExtensionsCtr();
__glXExtensionsCtrScreen( psc );
+
+ (void) memset( server_support, 0, sizeof( server_support ) );
__glXProcessServerString( known_glx_extensions,
psc->serverGLXexts, server_support );