Changeset 78076 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Timestamp:
- Apr 10, 2019 11:20:02 AM (6 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_get.py
r69390 r78076 127 127 local_argname = 'local_%s' % lastParam[0] 128 128 129 print('\t%s %s[%d] ;' % ( local_argtype, local_argname, max_components[func_name] ))129 print('\t%s %s[%d] = { 0 };' % ( local_argtype, local_argname, max_components[func_name] )) 130 130 print('\t(void) %s;' % lastParam[0]) 131 131 … … 142 142 print('\tcrServerReturnValue(&(%s[0]), %d*sizeof(%s));' % (local_argname, max_components[func_name], local_argtype )) 143 143 else: 144 print('\tcrServerReturnValue(&(%s[0]), crStateHlpComponentsCount(pname)*sizeof(%s));' % (local_argname, local_argtype )) 144 print('\tunsigned int cComponents = RT_MIN(crStateHlpComponentsCount(pname), RT_ELEMENTS(%s));' % local_argname) 145 print('\tcrServerReturnValue(&(%s[0]), cComponents*sizeof(%s));' % (local_argname, local_argtype )) 145 146 print ('}\n') -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_texture.c
r76787 r78076 176 176 crStateGetTexEnvfv( target, pname, local_params ); 177 177 178 crServerReturnValue( &(local_params[0]), crStateHlpComponentsCount(pname)*sizeof (GLfloat) ); 178 size_t cComponents = RT_MIN(crStateHlpComponentsCount(pname), RT_ELEMENTS(local_params)); 179 crServerReturnValue( &(local_params[0]), cComponents*sizeof (GLfloat) ); 179 180 } 180 181 … … 188 189 crStateGetTexEnviv( target, pname, local_params ); 189 190 190 crServerReturnValue( &(local_params[0]), crStateHlpComponentsCount(pname)*sizeof (GLint) ); 191 size_t cComponents = RT_MIN(crStateHlpComponentsCount(pname), RT_ELEMENTS(local_params)); 192 crServerReturnValue( &(local_params[0]), cComponents*sizeof (GLint) ); 191 193 } 192 194
Note:
See TracChangeset
for help on using the changeset viewer.