Changeset 71903 in vbox for trunk/src/VBox
- Timestamp:
- Apr 18, 2018 4:22:34 PM (7 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_client.c
r69392 r71903 2401 2401 CRASSERT(array && index>=0 && index<CRSTATECLIENT_MAX_VERTEXARRAYS); 2402 2402 2403 if (index<7) 2403 if (array == NULL || index < 0 || index >= CRSTATECLIENT_MAX_VERTEXARRAYS) 2404 { 2405 return NULL; 2406 } 2407 2408 if (index < 7) 2404 2409 { 2405 2410 switch (index) -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_program.c
r69392 r71903 692 692 693 693 if (target == GL_VERTEX_PROGRAM_NV) { 694 if (index >= UINT32_MAX - num) { 695 crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, 696 "glProgramParameters4dvNV(index+num) integer overflow"); 697 return; 698 } 699 694 700 if (index + num < g->limits.maxVertexProgramEnvParams) { 695 701 GLuint i; … … 732 738 733 739 if (target == GL_VERTEX_PROGRAM_NV) { 740 if (index >= UINT32_MAX - num) { 741 crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, 742 "glProgramParameters4dvNV(index+num) integer overflow"); 743 return; 744 } 745 734 746 if (index + num < g->limits.maxVertexProgramEnvParams) { 735 747 GLuint i; … … 850 862 return; 851 863 } 852 864 853 865 if (target == GL_VERTEX_PROGRAM_NV) { 854 if (address & 0x3) { 855 /* addr must be multiple of four */ 856 crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, 866 if (address & 0x3 || address >= g->limits.maxVertexProgramEnvParams) { 867 crStateError(__LINE__, __FILE__, GL_INVALID_VALUE, 857 868 "glTrackMatrixNV(address)"); 858 return;869 return; 859 870 } 860 871 -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_arrays.c
r69390 r71903 225 225 unsigned char *data; 226 226 227 offset = 2*sizeof(int)+12; 227 if (first < 0 || count <= 0 || first >= INT32_MAX - count) 228 { 229 crError("crUnpackExtendLockArraysEXT: first(%i) count(%i), parameters out of range", first, count); 230 return; 231 } 232 233 if (numenabled <= 0 || numenabled >= CRSTATECLIENT_MAX_VERTEXARRAYS) 234 { 235 crError("crUnpackExtendLockArraysEXT: numenabled(%i), parameter out of range", numenabled); 236 return; 237 } 238 239 offset = 2 * sizeof(int) + 12; 228 240 229 241 /*crDebug("crUnpackExtendLockArraysEXT(%i, %i) ne=%i", first, count, numenabled);*/ 230 242 231 for (i =0; i<numenabled; ++i)243 for (i = 0; i < numenabled; ++i) 232 244 { 233 245 index = READ_DATA(offset, int); 234 246 offset += sizeof(int); 247 235 248 cp = crStateGetClientPointerByIndex(index, &c->array); 249 236 250 CRASSERT(cp && cp->enabled && (!cp->buffer || !cp->buffer->id)); 237 data = crAlloc((first+count)*cp->bytesPerIndex); 238 crMemcpy(data+first*cp->bytesPerIndex, DATA_POINTER(offset, GLvoid), count*cp->bytesPerIndex); 239 offset += count*cp->bytesPerIndex; 240 /*crDebug("crUnpackExtendLockArraysEXT: old cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i", 241 index, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/ 242 crUnpackSetClientPointerByIndex(index, cp->size, cp->type, cp->normalized, 0, data, c); 243 /*crDebug("crUnpackExtendLockArraysEXT: new cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i", 244 index, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/ 245 } 251 252 if (cp && cp->bytesPerIndex > 0) 253 { 254 if (first + count >= INT32_MAX / cp->bytesPerIndex) 255 { 256 crError("crUnpackExtendLockArraysEXT: first(%i) count(%i) bpi(%i), parameters out of range", first, count, cp->bytesPerIndex); 257 return; 258 } 259 260 data = crAlloc((first + count) * cp->bytesPerIndex); 261 262 if (data) 263 { 264 crMemcpy(data + first * cp->bytesPerIndex, DATA_POINTER(offset, GLvoid), count * cp->bytesPerIndex); 265 /*crDebug("crUnpackExtendLockArraysEXT: old cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i", 266 index, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/ 267 crUnpackSetClientPointerByIndex(index, cp->size, cp->type, cp->normalized, 0, data, c); 268 /*crDebug("crUnpackExtendLockArraysEXT: new cp(%i): en/l=%i(%i) p=%p size=%i type=0x%x n=%i str=%i pp=%p pstr=%i", 269 index, cp->enabled, cp->locked, cp->p, cp->size, cp->type, cp->normalized, cp->stride, cp->prevPtr, cp->prevStride);*/ 270 } 271 else 272 { 273 crError("crUnpackExtendLockArraysEXT: crAlloc failed"); 274 return; 275 } 276 } 277 else 278 { 279 crError("crUnpackExtendLockArraysEXT: wrong CRClientState %i", index); 280 return; 281 } 282 283 offset += count * cp->bytesPerIndex; 284 } 285 246 286 cr_unpackDispatch.LockArraysEXT(first, count); 247 287 } -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_program.c
r69390 r71903 43 43 GLuint index = READ_DATA(12, GLuint); 44 44 GLuint num = READ_DATA(16, GLuint); 45 GLdouble *params = (GLdouble *) crAlloc(num * 4 * sizeof(GLdouble)); 45 GLdouble *params; 46 47 if (num >= UINT32_MAX / (4 * sizeof(GLdouble))) 48 { 49 crError("crUnpackExtendProgramParameters4dvNV: parameter 'num' is out of range"); 50 return; 51 } 52 53 params = (GLdouble *)crAlloc(num * 4 * sizeof(GLdouble)); 54 46 55 if (params) { 47 56 GLuint i; 48 57 for (i = 0; i < 4 * num; i++) { 49 params[i] = READ_DATA(20 + i * 8, GLdouble);58 params[i] = READ_DATA(20 + i * sizeof(GLdouble), GLdouble); 50 59 } 51 60 cr_unpackDispatch.ProgramParameters4dvNV(target, index, num, params); … … 60 69 GLuint index = READ_DATA(12, GLuint); 61 70 GLuint num = READ_DATA(16, GLuint); 62 GLfloat *params = (GLfloat *) crAlloc(num * 4 * sizeof(GLfloat)); 71 GLfloat *params; 72 73 if (num >= UINT32_MAX / (4 * sizeof(GLfloat))) 74 { 75 crError("crUnpackExtendProgramParameters4fvNV: parameter 'num' is out of range"); 76 return; 77 } 78 79 params = (GLfloat *)crAlloc(num * 4 * sizeof(GLfloat)); 80 63 81 if (params) { 64 82 GLuint i; 65 83 for (i = 0; i < 4 * num; i++) { 66 params[i] = READ_DATA(20 + i * 4, GLfloat);84 params[i] = READ_DATA(20 + i * sizeof(GLfloat), GLfloat); 67 85 } 68 86 cr_unpackDispatch.ProgramParameters4fvNV(target, index, num, params);
Note:
See TracChangeset
for help on using the changeset viewer.