Index: /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch.py
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch.py	(revision 50440)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch.py	(revision 50441)
@@ -47,4 +47,5 @@
     current = 0
     array = ""
+    condition = ""
     m = re.search( r"^(Color|Normal)([1234])(ub|b|us|s|ui|i|f|d)$", func_name )
     if m :
@@ -92,4 +93,5 @@
         type = m.group(3) + m.group(2)
         array = "[index]"
+        condition = "if (index < CR_MAX_VERTEX_ATTRIBS)"
     if func_name == "VertexAttrib4NubARB":
         current = 1
@@ -97,4 +99,5 @@
         type = "ub4"
         array = "[index]"
+        condition = "if (index < CR_MAX_VERTEX_ATTRIBS)"
 
     if current:
@@ -102,6 +105,9 @@
         print 'void SERVER_DISPATCH_APIENTRY crServerDispatch%s( %s )' % ( func_name, apiutil.MakeDeclarationString(params) )
         print '{'
-        print '\tcr_server.head_spu->dispatch_table.%s( %s );' % (func_name, apiutil.MakeCallString(params) )
-        print "\tcr_server.current.c.%s.%s%s = cr_unpackData;" % (name,type,array)
+        print '\t%s' % (condition)
+        print '\t{'
+        print '\n\tcr_server.head_spu->dispatch_table.%s( %s );' % (func_name, apiutil.MakeCallString(params) )
+        print "\t\tcr_server.current.c.%s.%s%s = cr_unpackData;" % (name,type,array)
+        print '\t}'
         print '}\n' 
 
Index: /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_simpleget.py
===================================================================
--- /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_simpleget.py	(revision 50440)
+++ /trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_simpleget.py	(revision 50441)
@@ -139,5 +139,12 @@
     	} 
     }
-    """ % (types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index])
+    else if (GL_MAX_VERTEX_ATTRIBS_ARB==pname)
+    {
+        if (CR_MAX_VERTEX_ATTRIBS < (GLuint)*get_values)
+        {
+            *get_values = (%s)CR_MAX_VERTEX_ATTRIBS;
+        } 
+    }
+    """ % (types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index], types[index])
     print '\tcrServerReturnValue( get_values, tablesize );'
     print '\tcrFree(get_values);'
