- Timestamp:
- Oct 17, 2018 4:58:38 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo
-
old new 8 8 /branches/VBox-5.0:104445,104938,104943,104950,104952-104953,104987-104988,104990,106453 9 9 /branches/VBox-5.1:112367,115992,116543,116550,116568,116573 10 /branches/VBox-5.2:120083,120099,120213,120221,120239,123597-123598,123600-123601,123755 10 /branches/VBox-5.2:120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,125768,125779-125780,125812 11 11 /branches/andy/draganddrop:90781-91268 12 12 /branches/andy/guestctrl20:78916,78930
-
- Property svn:mergeinfo
-
trunk/src/VBox
- Property svn:mergeinfo
-
old new 8 8 /branches/VBox-5.0/src/VBox:104938,104943,104950,104987-104988,104990,106453 9 9 /branches/VBox-5.1/src/VBox:112367,116543,116550,116568,116573 10 /branches/VBox-5.2/src/VBox:120083,120099,120213,120221,120239,123597-123598,123600-123601,123755 10 /branches/VBox-5.2/src/VBox:120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,125768,125779-125780,125812 11 11 /branches/andy/draganddrop/src/VBox:90781-91268 12 12 /branches/andy/guestctrl20/src/VBox:78916,78930
-
- Property svn:mergeinfo
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_pixel.c
r70601 r74890 343 343 void STATE_APIENTRY crStatePixelMapusv (GLenum map, GLint mapsize, const GLushort * values) 344 344 { 345 GLfloat fvalues[CR_MAX_PIXEL_MAP_TABLE]; 346 GLint i; 345 if (mapsize < 0 || mapsize > CR_MAX_PIXEL_MAP_TABLE) 346 { 347 crError("crStatePixelMapusv: parameter 'mapsize' is out of range"); 348 return; 349 } 347 350 348 351 if (!crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB)) 349 352 { 353 GLfloat fvalues[CR_MAX_PIXEL_MAP_TABLE]; 354 GLint i; 355 350 356 if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) { 351 357 for (i=0;i<mapsize;i++) { -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_bufferobject.c
r69390 r74890 26 26 crServerDispatchGenBuffersARB(GLsizei n, GLuint *buffers) 27 27 { 28 GLuint *local_buffers = (GLuint *) crAlloc( n * sizeof(*local_buffers) );29 28 GLuint *local_buffers; 29 (void) buffers; 30 30 31 crStateGenBuffersARB(n, local_buffers); 31 if (n >= INT32_MAX / sizeof(GLuint)) 32 { 33 crError("crServerDispatchGenBuffersARB: parameter 'n' is out of range"); 34 return; 35 } 32 36 33 crServerReturnValue( local_buffers, n * sizeof(*local_buffers) ); 34 crFree( local_buffers ); 37 local_buffers = (GLuint *)crCalloc(n * sizeof(*local_buffers)); 38 39 if (!local_buffers) 40 { 41 crError("crServerDispatchGenBuffersARB: out of memory"); 42 return; 43 } 44 45 crStateGenBuffersARB(n, local_buffers); 46 47 crServerReturnValue( local_buffers, n * sizeof(*local_buffers) ); 48 crFree( local_buffers ); 35 49 } 36 50 … … 50 64 51 65 void SERVER_DISPATCH_APIENTRY 52 crServerDispatchGetBufferSubDataARB(GLenum target, GLintptrARB offset, 53 GLsizeiptrARB size, void * data) 66 crServerDispatchGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, void * data) 54 67 { 55 68 void *b; 56 69 57 b = crAlloc(size);58 59 70 b = crCalloc(size); 71 if (b) { 72 cr_server.head_spu->dispatch_table.GetBufferSubDataARB( target, offset, size, b ); 60 73 61 62 63 64 65 66 74 crServerReturnValue( b, size ); 75 crFree( b ); 76 } 77 else { 78 crError("Out of memory in crServerDispatchGetBufferSubDataARB"); 79 } 67 80 } 68 81 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_framebuffer.c
r69500 r74890 26 26 crServerDispatchGenFramebuffersEXT(GLsizei n, GLuint *framebuffers) 27 27 { 28 GLuint *local_buffers = (GLuint *) crAlloc(n * sizeof(*local_buffers));28 GLuint *local_buffers; 29 29 (void) framebuffers; 30 31 if (n >= INT32_MAX / sizeof(GLuint)) 32 { 33 crError("crServerDispatchGenFramebuffersEXT: parameter 'n' is out of range"); 34 return; 35 } 36 37 local_buffers = (GLuint *)crCalloc(n * sizeof(*local_buffers)); 30 38 31 39 crStateGenFramebuffersEXT(n, local_buffers); … … 38 46 crServerDispatchGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) 39 47 { 40 GLuint *local_buffers = (GLuint *) crAlloc(n * sizeof(*local_buffers));48 GLuint *local_buffers; 41 49 (void) renderbuffers; 50 51 if (n >= INT32_MAX / sizeof(GLuint)) 52 { 53 crError("crServerDispatchGenRenderbuffersEXT: parameter 'n' is out of range"); 54 return; 55 } 56 57 local_buffers = (GLuint *)crCalloc(n * sizeof(*local_buffers)); 42 58 43 59 crStateGenRenderbuffersEXT(n, local_buffers); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_gentextures.c
r69390 r74890 14 14 void SERVER_DISPATCH_APIENTRY crServerDispatchGenTextures( GLsizei n, GLuint *textures ) 15 15 { 16 GLuint *local_textures = (GLuint *) crAlloc(n*sizeof(*local_textures));16 GLuint *local_textures; 17 17 (void) textures; 18 19 if (n >= INT32_MAX / sizeof(GLuint)) 20 { 21 crError("crServerDispatchGenTextures: parameter 'n' is out of range"); 22 return; 23 } 24 25 local_textures = (GLuint *)crCalloc(n * sizeof(*local_textures)); 26 27 if (!local_textures) 28 { 29 crError("crServerDispatchGenTextures: out of memory"); 30 return; 31 } 18 32 19 33 crStateGenTextures(n, local_textures); … … 25 39 void SERVER_DISPATCH_APIENTRY crServerDispatchGenProgramsNV( GLsizei n, GLuint * ids ) 26 40 { 27 GLuint *local_progs = (GLuint *) crAlloc( n*sizeof( *local_progs) );41 GLuint *local_progs; 28 42 (void) ids; 43 44 if (n >= INT32_MAX / sizeof(GLuint)) 45 { 46 crError("crServerDispatchGenProgramsNV: parameter 'n' is out of range"); 47 return; 48 } 49 50 local_progs = (GLuint *)crCalloc(n * sizeof(*local_progs)); 51 52 if (!local_progs) 53 { 54 crError("crServerDispatchGenProgramsNV: out of memory"); 55 return; 56 } 57 29 58 cr_server.head_spu->dispatch_table.GenProgramsNV( n, local_progs ); 30 59 crServerReturnValue( local_progs, n*sizeof( *local_progs ) ); … … 35 64 void SERVER_DISPATCH_APIENTRY crServerDispatchGenFencesNV( GLsizei n, GLuint * ids ) 36 65 { 37 GLuint *local_fences = (GLuint *) crAlloc( n*sizeof( *local_fences) );66 GLuint *local_fences; 38 67 (void) ids; 68 69 if (n >= INT32_MAX / sizeof(GLuint)) 70 { 71 crError("crServerDispatchGenFencesNV: parameter 'n' is out of range"); 72 return; 73 } 74 75 local_fences = (GLuint *)crCalloc(n * sizeof(*local_fences)); 76 77 if (!local_fences) 78 { 79 crError("crServerDispatchGenFencesNV: out of memory"); 80 return; 81 } 82 39 83 cr_server.head_spu->dispatch_table.GenFencesNV( n, local_fences ); 40 84 crServerReturnValue( local_fences, n*sizeof( *local_fences ) ); … … 47 91 GLsizei i; 48 92 (void) ids; 93 94 if (n >= INT32_MAX / sizeof(GLuint)) 95 { 96 crError("crServerDispatchGenProgramsARB: parameter 'n' is out of range"); 97 return; 98 } 99 100 local_progs = (GLuint *)crCalloc(n * sizeof(*local_progs)); 101 102 if (!local_progs) 103 { 104 crError("crServerDispatchGenProgramsARB: out of memory"); 105 return; 106 } 107 49 108 cr_server.head_spu->dispatch_table.GenProgramsARB( n, local_progs ); 50 109 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c
r73223 r74890 40 40 41 41 if (bufSize < INT32_MAX / 2) 42 pLocal = (crGetActive_t*)cr Alloc(bufSize + sizeof(crGetActive_t));42 pLocal = (crGetActive_t*)crCalloc(bufSize + sizeof(crGetActive_t)); 43 43 44 44 if (!pLocal) … … 49 49 return; 50 50 } 51 /* zero out just the header to ensure it initially contains zero size values */ 52 memset(pLocal, 0, sizeof (*pLocal)); 51 53 52 cr_server.head_spu->dispatch_table.GetActiveAttrib(crStateGetProgramHWID(program), index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]); 54 53 crServerReturnValue(pLocal, pLocal->length+1+sizeof(crGetActive_t)); … … 61 60 62 61 if (bufSize < INT32_MAX / 2) 63 pLocal = (crGetActive_t*) cr Alloc(bufSize + sizeof(crGetActive_t));62 pLocal = (crGetActive_t*) crCalloc(bufSize + sizeof(crGetActive_t)); 64 63 65 64 if (!pLocal) … … 70 69 return; 71 70 } 72 /* zero out just the header to ensure it initially contains zero size values */ 73 memset(pLocal, 0, sizeof (*pLocal)); 71 74 72 cr_server.head_spu->dispatch_table.GetActiveUniform(crStateGetProgramHWID(program), index, bufSize, &pLocal->length, &pLocal->size, &pLocal->type, (char*)&pLocal[1]); 75 73 crServerReturnValue(pLocal, pLocal->length+1+sizeof(crGetActive_t)); … … 82 80 83 81 if (maxCount < INT32_MAX / sizeof(GLuint) / 2) 84 pLocal = (GLsizei*) cr Alloc(maxCount * sizeof(GLuint) + sizeof(GLsizei));82 pLocal = (GLsizei*) crCalloc(maxCount * sizeof(GLuint) + sizeof(GLsizei)); 85 83 86 84 if (!pLocal) … … 111 109 112 110 if (maxCount < INT32_MAX / sizeof(VBoxGLhandleARB) / 2) 113 pLocal = (GLsizei*) cr Alloc(maxCount * sizeof(VBoxGLhandleARB) + sizeof(GLsizei));111 pLocal = (GLsizei*) crCalloc(maxCount * sizeof(VBoxGLhandleARB) + sizeof(GLsizei)); 114 112 115 113 if (!pLocal) … … 143 141 144 142 if (maxLength < INT32_MAX / 2) 145 pLocal = (GLsizei*) cr Alloc(maxLength + sizeof(GLsizei));143 pLocal = (GLsizei*) crCalloc(maxLength + sizeof(GLsizei)); 146 144 147 145 if (!pLocal) … … 167 165 168 166 if (bufSize < INT32_MAX / 2) 169 pLocal = (GLsizei*) cr Alloc(bufSize + sizeof(GLsizei));167 pLocal = (GLsizei*) crCalloc(bufSize + sizeof(GLsizei)); 170 168 171 169 if (!pLocal) … … 187 185 188 186 if (bufSize < INT32_MAX / 2) 189 pLocal = (GLsizei*) cr Alloc(bufSize + sizeof(GLsizei));187 pLocal = (GLsizei*) crCalloc(bufSize + sizeof(GLsizei)); 190 188 191 189 if (!pLocal) … … 208 206 209 207 if (bufSize < INT32_MAX / 2) 210 pLocal = (GLsizei*) cr Alloc(bufSize + sizeof(GLsizei));208 pLocal = (GLsizei*) crCalloc(bufSize + sizeof(GLsizei)); 211 209 212 210 if (!pLocal) … … 233 231 234 232 if (maxcbData < INT32_MAX / 2) 235 pLocal = (GLsizei*) cr Alloc(maxcbData + sizeof(GLsizei));233 pLocal = (GLsizei*) crCalloc(maxcbData + sizeof(GLsizei)); 236 234 237 235 if (!pLocal) … … 259 257 260 258 if (maxcbData < INT32_MAX / 2) 261 pLocal = (GLsizei*) cr Alloc(maxcbData + sizeof(GLsizei));259 pLocal = (GLsizei*) crCalloc(maxcbData + sizeof(GLsizei)); 262 260 263 261 if (!pLocal) … … 292 290 GLfloat *pLocal; 293 291 294 pLocal = (GLfloat*) cr Alloc(size);292 pLocal = (GLfloat*) crCalloc(size); 295 293 if (!pLocal) 296 294 { … … 311 309 GLint *pLocal; 312 310 313 pLocal = (GLint*) cr Alloc(size);311 pLocal = (GLint*) crCalloc(size); 314 312 if (!pLocal) 315 313 { -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getteximage.c
r69390 r74890 77 77 #endif 78 78 79 if (size && (buffer = cr Alloc(size))) {79 if (size && (buffer = crCalloc(size))) { 80 80 /* Note, the other pixel PACK parameters (default values) should 81 81 * be OK at this point. … … 118 118 cr_server.head_spu->dispatch_table.GetTexLevelParameteriv(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &size); 119 119 120 if (size && (buffer = cr Alloc(size))) {120 if (size && (buffer = crCalloc(size))) { 121 121 /* XXX the pixel PACK parameter should be OK at this point */ 122 122 cr_server.head_spu->dispatch_table.GetCompressedTexImageARB(target, level, buffer); … … 149 149 GLubyte local_mask[128]; 150 150 151 memset(local_mask, 0, sizeof(local_mask)); 152 151 153 cr_server.head_spu->dispatch_table.GetPolygonStipple( local_mask ); 152 154 crServerReturnValue( &(local_mask[0]), 128*sizeof(GLubyte) ); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c
r70601 r74890 182 182 GLint i; 183 183 184 if (n >= UINT32_MAX / sizeof(GLuint))184 if (n >= INT32_MAX / sizeof(GLuint)) 185 185 { 186 186 crError("crServerDispatchDeleteProgramsARB: parameter 'n' is out of range"); … … 218 218 GLboolean *residences) 219 219 { 220 GLboolean retval ;221 GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean));220 GLboolean retval = GL_FALSE; 221 GLboolean *res; 222 222 GLsizei i; 223 224 223 (void) residences; 225 224 225 if (n >= INT32_MAX / sizeof(GLuint)) 226 { 227 crError("crServerDispatchAreProgramsResidentNV: parameter 'n' is out of range"); 228 return GL_FALSE; 229 } 230 231 res = (GLboolean *)crCalloc(n * sizeof(GLboolean)); 232 233 if (!res) { 234 crError("crServerDispatchAreProgramsResidentNV: out of memory"); 235 return GL_FALSE; 236 } 237 226 238 if (!cr_server.sharedTextureObjects) { 227 GLuint *programs2 = (GLuint *) crAlloc(n * sizeof(GLuint)); 228 for (i = 0; i < n; i++) 229 programs2[i] = crServerTranslateProgramID(programs[i]); 230 retval = cr_server.head_spu->dispatch_table.AreProgramsResidentNV(n, programs2, res); 231 crFree(programs2); 239 GLuint *programs2 = (GLuint *) crCalloc(n * sizeof(GLuint)); 240 if (programs2) 241 { 242 for (i = 0; i < n; i++) 243 programs2[i] = crServerTranslateProgramID(programs[i]); 244 245 retval = cr_server.head_spu->dispatch_table.AreProgramsResidentNV(n, programs2, res); 246 crFree(programs2); 247 } 248 else 249 { 250 crError("crServerDispatchAreProgramsResidentNV: out of memory"); 251 } 232 252 } 233 253 else { -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_lists.c
r70601 r74890 230 230 crServerDispatchCallLists( GLsizei n, GLenum type, const GLvoid *lists ) 231 231 { 232 if (n >= UINT32_MAX / sizeof(GLuint))232 if (n >= INT32_MAX / sizeof(GLuint)) 233 233 { 234 234 crError("crServerDispatchCallLists: parameter 'n' is out of range"); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_misc.c
r69390 r74890 26 26 GLubyte local_storage[4096]; 27 27 GLint bytes = 0; 28 GLint cbType = 1; /* One byte by default. */ 29 30 memset(local_storage, 0, sizeof(local_storage)); 28 31 29 32 switch (type) { 30 33 case GL_BYTE: 31 34 case GL_UNSIGNED_BYTE: 32 bytes = count *sizeof(GLbyte);35 cbType = sizeof(GLbyte); 33 36 break; 34 37 case GL_SHORT: 35 38 case GL_UNSIGNED_SHORT: 36 bytes = count *sizeof(GLshort);39 cbType = sizeof(GLshort); 37 40 break; 38 41 case GL_INT: 39 42 case GL_UNSIGNED_INT: 40 bytes = count *sizeof(GLint);43 cbType = sizeof(GLint); 41 44 break; 42 45 case GL_FLOAT: 43 bytes = count *sizeof(GLfloat);46 cbType = sizeof(GLfloat); 44 47 break; 45 48 case GL_DOUBLE: 46 bytes = count *sizeof(GLdouble);49 cbType = sizeof(GLdouble); 47 50 break; 48 51 default: 49 52 crError("Bad type in crServerDispatchGetChromiumParametervCR"); 50 53 } 54 55 if (count < 0) /* 'GLsizei' is usually an 'int'. */ 56 count = 0; 57 else if ((size_t)count > sizeof(local_storage) / cbType) 58 count = sizeof(local_storage) / cbType; 59 60 bytes = count * cbType; 51 61 52 62 CRASSERT(bytes >= 0); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_occlude.c
r69390 r74890 14 14 crServerDispatchGenQueriesARB(GLsizei n, GLuint *queries) 15 15 { 16 GLuint *local_queries = (GLuint *) crAlloc( n * sizeof(*local_queries) ); 17 (void) queries; 18 cr_server.head_spu->dispatch_table.GenQueriesARB( n, local_queries ); 19 crServerReturnValue( local_queries, n * sizeof(*local_queries) ); 20 crFree( local_queries ); 16 GLuint *local_queries; 17 (void) queries; 18 19 if (n >= INT32_MAX / sizeof(GLuint)) 20 { 21 crError("crServerDispatchGenQueriesARB: parameter 'n' is out of range"); 22 return; 23 } 24 25 local_queries = (GLuint *)crCalloc(n * sizeof(*local_queries)); 26 27 if (!local_queries) 28 { 29 crError("crServerDispatchGenQueriesARB: out of memory"); 30 return; 31 } 32 33 cr_server.head_spu->dispatch_table.GenQueriesARB( n, local_queries ); 34 35 crServerReturnValue( local_queries, n * sizeof(*local_queries) ); 36 crFree( local_queries ); 21 37 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_readpixels.c
r69390 r74890 20 20 GLenum format, GLenum type, GLvoid *pixels) 21 21 { 22 CRMessageReadPixels *rp;23 22 const GLint stride = READ_DATA( 24, GLint ); 24 23 const GLint alignment = READ_DATA( 28, GLint ); … … 27 26 const GLint bytes_per_row = READ_DATA( 40, GLint ); 28 27 const GLint rowLength = READ_DATA( 44, GLint ); 29 const int msg_len = sizeof(*rp) + bytes_per_row * height;30 28 31 29 CRASSERT(bytes_per_row > 0); … … 48 46 #endif 49 47 { 48 CRMessageReadPixels *rp; 49 uint32_t msg_len; 50 51 if (bytes_per_row < 0 || bytes_per_row > UINT32_MAX / 8 || height > UINT32_MAX / 8) 52 { 53 crError("crServerDispatchReadPixels: parameters out of range"); 54 return; 55 } 56 57 msg_len = sizeof(*rp) + (uint32_t)bytes_per_row * height; 58 50 59 rp = (CRMessageReadPixels *) crAlloc( msg_len ); 60 if (!rp) 61 { 62 crError("crServerDispatchReadPixels: out of memory"); 63 return; 64 } 51 65 52 66 /* Note: the ReadPixels data gets densely packed into the buffer -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_retval.py
r69390 r74890 25 25 { 26 26 CRMessageReadback *rb; 27 int msg_len = sizeof( *rb ) + payload_len;28 27 int msg_len; 28 29 29 /* Don't reply to client if we're loading VM snapshot*/ 30 30 if (cr_server.bIsInLoadingState) 31 31 return; 32 32 33 33 if (cr_server.curClient->conn->type == CR_FILE) 34 34 { 35 35 return; 36 36 } 37 37 38 if (payload_len >= INT32_MAX - sizeof( *rb )) 39 { 40 return; 41 } 42 43 msg_len = sizeof( *rb ) + payload_len; 38 44 rb = (CRMessageReadback *) crAlloc( msg_len ); 39 45 40 46 rb->header.type = CR_MESSAGE_READBACK; 41 47 CRDBGPTR_PRINTRB(cr_server.curClient->conn->u32ClientID, &cr_server.writeback_ptr); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_texture.c
r70601 r74890 236 236 void SERVER_DISPATCH_APIENTRY crServerDispatchPrioritizeTextures( GLsizei n, const GLuint * textures, const GLclampf * priorities ) 237 237 { 238 GLuint *newTextures = (GLuint *) crAlloc(n * sizeof(GLuint));238 GLuint *newTextures; 239 239 GLint i; 240 240 241 if (n >= INT32_MAX / sizeof(GLuint)) 242 { 243 crError("crServerDispatchPrioritizeTextures: parameter 'n' is out of range"); 244 return; 245 } 246 247 newTextures = (GLuint *)crAlloc(n * sizeof(GLuint)); 248 241 249 if (!newTextures) 242 250 { 243 crError("crServerDispatch DeleteTextures: out of memory");251 crError("crServerDispatchPrioritizeTextures: out of memory"); 244 252 return; 245 253 } … … 271 279 GLboolean *residences) 272 280 { 273 GLboolean retval ;281 GLboolean retval = GL_FALSE; 274 282 GLsizei i; 275 GLboolean *res = (GLboolean *) crAlloc(n * sizeof(GLboolean)); 276 GLuint *textures2 = (GLuint *) crAlloc(n * sizeof(GLuint)); 277 283 GLboolean *res; 284 GLuint *textures2; 278 285 (void) residences; 279 286 287 if (n >= INT32_MAX / sizeof(GLuint)) 288 { 289 crError("crServerDispatchAreTexturesResident: parameter 'n' is out of range"); 290 return GL_FALSE; 291 } 292 293 res = (GLboolean *)crCalloc(n * sizeof(GLboolean)); 294 if (!res) 295 { 296 crError("crServerDispatchAreTexturesResident: out of memory"); 297 return GL_FALSE; 298 } 299 300 textures2 = (GLuint *)crAlloc(n * sizeof(GLuint)); 301 302 if (!textures2) 303 { 304 crError("crServerDispatchAreTexturesResident: out of memory"); 305 crFree(res); 306 return GL_FALSE; 307 } 308 280 309 for (i = 0; i < n; i++) 281 310 { -
trunk/src/VBox/HostServices/SharedOpenGL/dlm/dlm_lists.c
r69500 r74890 353 353 354 354 crDebug("DLM: CallLists(%d, %u, %p).", n, type, lists); 355 356 if (n >= INT32_MAX / sizeof(GLuint)) 357 { 358 crError("crDLMCallLists: parameter 'n' is out of range"); 359 return; 360 } 355 361 356 362 if (pListState) -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_map.c
r69390 r74890 8 8 #include "cr_error.h" 9 9 #include "cr_mem.h" 10 #include "state/cr_limits.h" 10 11 11 12 12 13 void crUnpackMap2d(void) 13 14 { 14 GLenum target = READ_DATA(sizeof(int) + 0, GLenum); 15 GLdouble u1 = READ_DOUBLE(sizeof(int) + 4); 16 GLdouble u2 = READ_DOUBLE(sizeof(int) + 12); 17 GLint ustride = READ_DATA(sizeof(int) + 20, GLint); 18 GLint uorder = READ_DATA(sizeof(int) + 24, GLint); 19 GLdouble v1 = READ_DOUBLE(sizeof(int) + 28); 20 GLdouble v2 = READ_DOUBLE(sizeof(int) + 36); 21 GLint vstride = READ_DATA(sizeof(int) + 44, GLint); 22 GLint vorder = READ_DATA(sizeof(int) + 48, GLint); 15 GLenum target = READ_DATA(sizeof(int) + 0, GLenum); 16 GLdouble u1 = READ_DOUBLE(sizeof(int) + 4); 17 GLdouble u2 = READ_DOUBLE(sizeof(int) + 12); 18 GLint ustride = READ_DATA(sizeof(int) + 20, GLint); 19 GLint uorder = READ_DATA(sizeof(int) + 24, GLint); 20 GLdouble v1 = READ_DOUBLE(sizeof(int) + 28); 21 GLdouble v2 = READ_DOUBLE(sizeof(int) + 36); 22 GLint vstride = READ_DATA(sizeof(int) + 44, GLint); 23 GLint vorder = READ_DATA(sizeof(int) + 48, GLint); 24 GLdouble *points = DATA_POINTER(sizeof(int) + 52, GLdouble); 25 GLint cbMax; 23 26 24 int n_points = READ_DATA(0, int) - (sizeof(int) + 52); 25 GLdouble *points; 27 if (uorder < 1 || uorder > CR_MAX_EVAL_ORDER || 28 vorder < 1 || vorder > CR_MAX_EVAL_ORDER || 29 ustride < 1 || ustride > INT32_MAX / (ssize_t)sizeof(double) / uorder / 8 || 30 vstride < 1 || vstride > INT32_MAX / (ssize_t)sizeof(double) / vorder / 8 ) 31 { 32 crError("crUnpackMap2d: parameters out of range"); 33 return; 34 } 26 35 27 if (n_points & 0x7) 28 crError("crUnpackMap2d: n_points=%d, expected multiple of 8\n", n_points); 29 points = (GLdouble *) crAlloc(n_points); 30 crMemcpy(points, DATA_POINTER(sizeof(int) + 52, GLdouble), n_points); 36 cbMax = (ustride * uorder + vstride * vorder) * sizeof(double); 37 if (!DATA_POINTER_CHECK(cbMax - 1)) 38 { 39 crError("crUnpackMap2d: parameters out of range"); 40 return; 41 } 31 42 32 cr_unpackDispatch.Map2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, 33 points); 34 crFree(points); 43 cr_unpackDispatch.Map2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); 35 44 36 45 INCR_VAR_PTR(); 37 46 } 38 47 39 48 void crUnpackMap2f(void) 40 49 { 41 GLenum target = READ_DATA(sizeof(int) + 0, GLenum); 42 GLfloat u1 = READ_DATA(sizeof(int) + 4, GLfloat); 43 GLfloat u2 = READ_DATA(sizeof(int) + 8, GLfloat); 44 GLint ustride = READ_DATA(sizeof(int) + 12, GLint); 45 GLint uorder = READ_DATA(sizeof(int) + 16, GLint); 46 GLfloat v1 = READ_DATA(sizeof(int) + 20, GLfloat); 47 GLfloat v2 = READ_DATA(sizeof(int) + 24, GLfloat); 48 GLint vstride = READ_DATA(sizeof(int) + 28, GLint); 49 GLint vorder = READ_DATA(sizeof(int) + 32, GLint); 50 GLfloat *points = DATA_POINTER(sizeof(int) + 36 , GLfloat); 50 GLenum target = READ_DATA(sizeof(int) + 0, GLenum); 51 GLfloat u1 = READ_DATA(sizeof(int) + 4, GLfloat); 52 GLfloat u2 = READ_DATA(sizeof(int) + 8, GLfloat); 53 GLint ustride = READ_DATA(sizeof(int) + 12, GLint); 54 GLint uorder = READ_DATA(sizeof(int) + 16, GLint); 55 GLfloat v1 = READ_DATA(sizeof(int) + 20, GLfloat); 56 GLfloat v2 = READ_DATA(sizeof(int) + 24, GLfloat); 57 GLint vstride = READ_DATA(sizeof(int) + 28, GLint); 58 GLint vorder = READ_DATA(sizeof(int) + 32, GLint); 59 GLfloat *points = DATA_POINTER(sizeof(int) + 36, GLfloat); 60 GLint cbMax; 51 61 52 cr_unpackDispatch.Map2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, 53 points); 54 INCR_VAR_PTR(); 62 if (uorder < 1 || uorder > CR_MAX_EVAL_ORDER || 63 vorder < 1 || vorder > CR_MAX_EVAL_ORDER || 64 ustride < 1 || ustride > INT32_MAX / (ssize_t)sizeof(float) / uorder / 8 || 65 vstride < 1 || vstride > INT32_MAX / (ssize_t)sizeof(float) / vorder / 8) 66 { 67 crError("crUnpackMap2d: parameters out of range"); 68 return; 69 } 70 71 cbMax = (ustride * uorder + vstride * vorder) * sizeof(float); 72 if (!DATA_POINTER_CHECK(cbMax - 1)) 73 { 74 crError("crUnpackMap2f: parameters out of range"); 75 return; 76 } 77 78 cr_unpackDispatch.Map2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); 79 80 INCR_VAR_PTR(); 55 81 } 56 82 57 83 void crUnpackMap1d(void) 58 84 { 59 GLenum target = READ_DATA(sizeof(int) + 0, GLenum); 60 GLdouble u1 = READ_DOUBLE(sizeof(int) + 4); 61 GLdouble u2 = READ_DOUBLE(sizeof(int) + 12); 62 GLint stride = READ_DATA(sizeof(int) + 20, GLint); 63 GLint order = READ_DATA(sizeof(int) + 24, GLint); 85 GLenum target = READ_DATA(sizeof(int) + 0, GLenum); 86 GLdouble u1 = READ_DOUBLE(sizeof(int) + 4); 87 GLdouble u2 = READ_DOUBLE(sizeof(int) + 12); 88 GLint stride = READ_DATA(sizeof(int) + 20, GLint); 89 GLint order = READ_DATA(sizeof(int) + 24, GLint); 90 GLdouble *points = DATA_POINTER(sizeof(int) + 28, GLdouble); 91 GLint cbMax; 64 92 65 int n_points = READ_DATA(0, int) - (sizeof(int) + 28); 66 GLdouble *points; 93 if (order < 1 || order > CR_MAX_EVAL_ORDER || 94 stride < 1 || stride > INT32_MAX / (ssize_t)sizeof(double) / order / 8) 95 { 96 crError("crUnpackMap1d: parameters out of range"); 97 return; 98 } 67 99 68 if (n_points & 0x7) 69 crError("crUnpackMap1d: n_points=%d, expected multiple of 8\n", n_points); 70 points = (GLdouble *) crAlloc(n_points); 71 crMemcpy(points, DATA_POINTER(sizeof(int) + 28, GLdouble), n_points); 72 73 cr_unpackDispatch.Map1d(target, u1, u2, stride, order, points); 74 crFree(points); 100 cbMax = stride * order * sizeof(double); 101 if (!DATA_POINTER_CHECK(cbMax - 1)) 102 { 103 crError("crUnpackMap1d: parameters out of range"); 104 return; 105 } 75 106 76 INCR_VAR_PTR(); 107 cr_unpackDispatch.Map1d(target, u1, u2, stride, order, points); 108 109 INCR_VAR_PTR(); 77 110 } 78 111 79 112 void crUnpackMap1f(void) 80 113 { 81 GLenum target = READ_DATA(sizeof(int) + 0, GLenum); 82 GLfloat u1 = READ_DATA(sizeof(int) + 4, GLfloat); 83 GLfloat u2 = READ_DATA(sizeof(int) + 8, GLfloat); 84 GLint stride = READ_DATA(sizeof(int) + 12, GLint); 85 GLint order = READ_DATA(sizeof(int) + 16, GLint); 86 GLfloat *points = DATA_POINTER(sizeof(int) + 20, GLfloat); 114 GLenum target = READ_DATA(sizeof(int) + 0, GLenum); 115 GLfloat u1 = READ_DATA(sizeof(int) + 4, GLfloat); 116 GLfloat u2 = READ_DATA(sizeof(int) + 8, GLfloat); 117 GLint stride = READ_DATA(sizeof(int) + 12, GLint); 118 GLint order = READ_DATA(sizeof(int) + 16, GLint); 119 GLfloat *points = DATA_POINTER(sizeof(int) + 20, GLfloat); 120 GLint cbMax; 87 121 88 cr_unpackDispatch.Map1f(target, u1, u2, stride, order, points); 89 INCR_VAR_PTR(); 122 if (order < 1 || order > CR_MAX_EVAL_ORDER || 123 stride < 1 || stride > INT32_MAX / (ssize_t)sizeof(float) / order / 8) 124 { 125 crError("crUnpackMap1f: parameters out of range"); 126 return; 127 } 128 129 cbMax = stride * order * sizeof(float); 130 if (!DATA_POINTER_CHECK(cbMax - 1)) 131 { 132 crError("crUnpackMap1f: parameters out of range"); 133 return; 134 } 135 136 cr_unpackDispatch.Map1f(target, u1, u2, stride, order, points); 137 INCR_VAR_PTR(); 90 138 }
Note:
See TracChangeset
for help on using the changeset viewer.