Changeset 71903 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_program.c
- Timestamp:
- Apr 18, 2018 4:22:34 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 122141
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.