Changeset 78105 in vbox
- Timestamp:
- Apr 10, 2019 8:01:12 PM (6 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_evaluators.c
r69392 r78105 360 360 } 361 361 362 switch (target) { 363 case GL_MAP1_VERTEX_3: 364 case GL_MAP1_VERTEX_4: 365 case GL_MAP1_INDEX: 366 case GL_MAP1_COLOR_4: 367 case GL_MAP1_NORMAL: 368 case GL_MAP1_TEXTURE_COORD_1: 369 case GL_MAP1_TEXTURE_COORD_2: 370 case GL_MAP1_TEXTURE_COORD_3: 371 case GL_MAP1_TEXTURE_COORD_4: 372 break; 373 default: 374 crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glMap1d(bad target)"); 375 return; 376 } 377 362 378 i = target - GL_MAP1_COLOR_4; 363 379 … … 378 394 crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION, 379 395 "glMap1d(current texture unit must be zero)"); 380 return;381 }382 383 switch (target) {384 case GL_MAP1_VERTEX_3:385 case GL_MAP1_VERTEX_4:386 case GL_MAP1_INDEX:387 case GL_MAP1_COLOR_4:388 case GL_MAP1_NORMAL:389 case GL_MAP1_TEXTURE_COORD_1:390 case GL_MAP1_TEXTURE_COORD_2:391 case GL_MAP1_TEXTURE_COORD_3:392 case GL_MAP1_TEXTURE_COORD_4:393 break;394 default:395 crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glMap1d(bad target)");396 396 return; 397 397 } … … 474 474 } 475 475 476 if (g->extensions.NV_vertex_program) { 476 switch (target) { 477 case GL_MAP2_VERTEX_3: 478 case GL_MAP2_VERTEX_4: 479 case GL_MAP2_INDEX: 480 case GL_MAP2_COLOR_4: 481 case GL_MAP2_NORMAL: 482 case GL_MAP2_TEXTURE_COORD_1: 483 case GL_MAP2_TEXTURE_COORD_2: 484 case GL_MAP2_TEXTURE_COORD_3: 485 case GL_MAP2_TEXTURE_COORD_4: 486 break; 487 default: 488 crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glMap2d()"); 489 return; 490 } 491 492 if (g->extensions.NV_vertex_program) { 477 493 /* XXX FIXME */ 478 494 i = target - GL_MAP2_COLOR_4; … … 508 524 } 509 525 #endif 510 511 switch (target) {512 case GL_MAP2_VERTEX_3:513 case GL_MAP2_VERTEX_4:514 case GL_MAP2_INDEX:515 case GL_MAP2_COLOR_4:516 case GL_MAP2_NORMAL:517 case GL_MAP2_TEXTURE_COORD_1:518 case GL_MAP2_TEXTURE_COORD_2:519 case GL_MAP2_TEXTURE_COORD_3:520 case GL_MAP2_TEXTURE_COORD_4:521 break;522 default:523 crStateError(__LINE__, __FILE__, GL_INVALID_ENUM, "glMap2d()");524 return;525 }526 526 527 527 /* make copy of the control points */ -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_teximage.c
r76811 r78105 218 218 CRTextureState *t = &(g->texture); 219 219 CRTextureUnit *unit = t->unit + t->curTextureUnit; 220 221 if (level < 0 || level > MaxTextureLevel(g, texTarget)) { 222 crWarning("Wrong texture level=%d", level); 223 *obj = NULL; 224 *img = NULL; 225 return; 226 } 227 228 if (level < 0 || level >= CR_MAX_MIPMAP_LEVELS) 229 { 230 crWarning("unexpected level 0x%x", level); 231 *obj = NULL; 232 *img = NULL; 233 } 220 234 221 235 switch (texTarget) { … … 691 705 CRTextureLevel *tl = NULL; 692 706 (void)x; (void)y; 707 708 if (level < 0 || level > MaxTextureLevel(g, target)) { 709 crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, 710 "crStateCopyTexImage2D: invalid level: %d", level); 711 return; 712 } 693 713 694 714 crStateGetTextureObjectAndImage(g, target, level, &tobj, &tl); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter/server_presenter.cpp
r76553 r78105 146 146 static int8_t crFbImgFromDimOffVramBGRA(VBOXCMDVBVAOFFSET offVRAM, uint32_t width, uint32_t height, CR_BLITTER_IMG *pImg) 147 147 { 148 uint32_t cbBuff = width * height * 4; 148 uint32_t cbBuff; 149 150 if (width == 0 || height == 0) 151 { 152 WARN(("invalid param")); 153 return -1; 154 } 155 156 cbBuff = width * height * 4; 157 // Check if overflow happened 158 if (cbBuff / width != height * 4) 159 { 160 WARN(("invalid param")); 161 return -1; 162 } 163 149 164 if (offVRAM >= g_cbVRam 165 || UINT32_MAX - cbBuff <= offVRAM 150 166 || offVRAM + cbBuff >= g_cbVRam) 151 167 { -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_get.py
r78078 r78105 49 49 'GetProgramParameterfvNV': 4, 50 50 'GetProgramivNV': 1, 51 'GetTrackMatrixivNV': 1,51 'GetTrackMatrixivNV': 24, 52 52 'GetVertexAttribPointervNV': 1, 53 53 'GetVertexAttribdvNV': 4, … … 127 127 local_argname = 'local_%s' % lastParam[0] 128 128 129 print('\tunsigned int cComponents = 0;'); 129 if not func_name in no_pnames: 130 print('\tunsigned int cComponents = 0;'); 130 131 print('\t%s %s[%d] = { 0 };' % ( local_argtype, local_argname, max_components[func_name] )) 131 132 print('\t(void) %s;' % lastParam[0]) -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getpixelmap.c
r69390 r78105 80 80 81 81 size *= tabsize; 82 local_values = (GLfloat*)cr Alloc( size );82 local_values = (GLfloat*)crCalloc( size ); 83 83 84 84 cr_server.head_spu->dispatch_table.GetPixelMapfv( map, local_values ); … … 107 107 108 108 size *= tabsize; 109 local_values = (GLuint*)cr Alloc( size );109 local_values = (GLuint*)crCalloc( size ); 110 110 111 111 cr_server.head_spu->dispatch_table.GetPixelMapuiv( map, local_values ); … … 134 134 135 135 size *= tabsize; 136 local_values = (GLushort*)cr Alloc( size );136 local_values = (GLushort*)crCalloc( size ); 137 137 138 138 cr_server.head_spu->dispatch_table.GetPixelMapusv( map, local_values ); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c
r76787 r78105 359 359 void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterfvARB( VBoxGLhandleARB obj, GLenum pname, GLfloat * params ) 360 360 { 361 GLfloat local_params[1] ;361 GLfloat local_params[1] = {0}; 362 362 GLuint hwid = crStateGetProgramHWID(obj); 363 363 (void) params; … … 378 378 void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterivARB( VBoxGLhandleARB obj, GLenum pname, GLint * params ) 379 379 { 380 GLint local_params[1] ;380 GLint local_params[1] = {0}; 381 381 GLuint hwid = crStateGetProgramHWID(obj); 382 382 if (!hwid) -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c
r76787 r78105 151 151 void SERVER_DISPATCH_APIENTRY crServerDispatchGetProgramiv( GLuint program, GLenum pname, GLint * params ) 152 152 { 153 GLint local_params[1] ;153 GLint local_params[1] = {0}; 154 154 (void) params; 155 155 cr_server.head_spu->dispatch_table.GetProgramiv(crStateGetProgramHWID(program), pname, local_params); … … 159 159 void SERVER_DISPATCH_APIENTRY crServerDispatchGetShaderiv( GLuint shader, GLenum pname, GLint * params ) 160 160 { 161 GLint local_params[1] ;161 GLint local_params[1] = {0}; 162 162 (void) params; 163 163 cr_server.head_spu->dispatch_table.GetShaderiv( crStateGetShaderHWID(shader), pname, local_params ); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_papi.c
r69390 r78105 32 32 cr_server.head_spu->dispatch_table.ChromiumParametervCR( GL_PRINT_STRING_CR, GL_UNSIGNED_BYTE, sizeof(debug_buf), debug_buf ); 33 33 #endif 34 35 if (count > CR_MAX_CLIENTS) 36 count = CR_MAX_CLIENTS; 37 34 38 if (count == 0) 35 39 { -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_misc.c
r69390 r78105 26 26 GLsizei n = READ_DATA( 8, GLsizei ); 27 27 const GLuint *ids = DATA_POINTER(12, GLuint); 28 29 if (n <= 0 || n >= INT32_MAX / sizeof(GLint) / 4 || !DATA_POINTER_CHECK(12 + n * sizeof(GLuint))) 30 { 31 crError("crUnpackExtendDeleteQueriesARB: parameter 'n' is out of range"); 32 return; 33 } 34 28 35 cr_unpackDispatch.DeleteQueriesARB(n, ids); 29 36 } … … 84 91 GLint cRects = READ_DATA( 24, GLint ); 85 92 GLint *pRects = (GLint *)DATA_POINTER( 28, GLvoid ); 93 94 if (cRects <= 0 || cRects >= INT32_MAX / sizeof(GLint) / 8 || !DATA_POINTER_CHECK(28 + 4 * cRects * sizeof(GLint))) 95 { 96 crError("crUnpackExtendVBoxTexPresent: parameter 'cRects' is out of range"); 97 return; 98 } 99 86 100 cr_unpackDispatch.VBoxTexPresent( texture, cfg, xPos, yPos, cRects, pRects ); 87 101 } -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.c
r76787 r78105 43 43 int pos, pos_check; 44 44 45 if (count <= 0 || count >= INT32_MAX / sizeof( char *) / 4)45 if (count <= 0 || count >= INT32_MAX / sizeof(GLint) / 8) 46 46 { 47 47 crError("crUnpackExtendShaderSource: count %u is out of range", count); … … 50 50 51 51 pos = 20 + count * sizeof(*pLocalLength); 52 53 if (!DATA_POINTER_CHECK(pos)) 54 { 55 crError("crUnpackExtendShaderSource: pos %d is out of range", pos); 56 return; 57 } 52 58 53 59 if (hasNonLocalLen > 0) … … 57 63 } 58 64 65 if (!DATA_POINTER_CHECK(pos)) 66 { 67 crError("crUnpackExtendShaderSource: pos %d is out of range", pos); 68 return; 69 } 70 59 71 pos_check = pos; 60 72 61 if (!DATA_POINTER_CHECK(pos_check))62 {63 crError("crUnpackExtendShaderSource: pos %d is out of range", pos_check);64 return;65 }66 67 73 for (i = 0; i < count; ++i) 68 74 { 69 if (pLocalLength[i] <= 0 || pos_check >= INT32_MAX - pLocalLength[i] || !DATA_POINTER_CHECK(pos_check))75 if (pLocalLength[i] <= 0 || pos_check >= INT32_MAX - pLocalLength[i]) 70 76 { 71 77 crError("crUnpackExtendShaderSource: pos %d is out of range", pos_check); … … 74 80 75 81 pos_check += pLocalLength[i]; 82 83 if (!DATA_POINTER_CHECK(pos_check)) 84 { 85 crError("crUnpackExtendShaderSource: pos %d is out of range", pos_check); 86 return; 87 } 76 88 } 77 89
Note:
See TracChangeset
for help on using the changeset viewer.