Changeset 71468 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/unpacker
- Timestamp:
- Mar 22, 2018 6:48:08 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121437
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/unpacker
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py
r69390 r71468 26 26 27 27 DECLEXPORT(const unsigned char *) cr_unpackData = NULL; 28 DECLEXPORT(const unsigned char *) cr_unpackDataEnd = NULL; 28 29 SPUDispatchTable cr_unpackDispatch; 29 30 … … 240 241 } 241 242 242 void crUnpack( const void *data, const void * opcodes,243 void crUnpack( const void *data, const void *data_end, const void *opcodes, 243 244 unsigned int num_opcodes, SPUDispatchTable *table ) 244 245 { … … 253 254 unpack_opcodes = (const unsigned char *)opcodes; 254 255 cr_unpackData = (const unsigned char *)data; 256 cr_unpackDataEnd = (const unsigned char *)data; 255 257 256 258 #if defined(CR_UNPACK_DEBUG_OPCODES) || defined(CR_UNPACK_DEBUG_LAST_OPCODES) -
trunk/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_shaders.c
r71462 r71468 41 41 char **ppStrings = NULL; 42 42 GLsizei i, j, jUpTo; 43 int pos=20+count*sizeof(*pLocalLength); 44 45 if (hasNonLocalLen>0) 46 { 47 length = DATA_POINTER(pos, GLint); 48 pos += count*sizeof(*length); 49 } 50 51 if (count >= UINT32_MAX / sizeof(char*)) 43 int pos, pos_check; 44 45 if (count >= UINT32_MAX / sizeof(char *) / 4) 52 46 { 53 47 crError("crUnpackExtendShaderSource: count %u is out of range", count); … … 55 49 } 56 50 57 ppStrings = crAlloc(count*sizeof(char*)); 51 pos = 20 + count * sizeof(*pLocalLength); 52 53 if (hasNonLocalLen > 0) 54 { 55 length = DATA_POINTER(pos, GLint); 56 pos += count * sizeof(*length); 57 } 58 59 pos_check = pos; 60 61 if (!DATA_POINTER_CHECK(pos_check)) 62 { 63 crError("crUnpackExtendShaderSource: pos %d is out of range", pos_check); 64 return; 65 } 66 67 for (i = 0; i < count; ++i) 68 { 69 if (pLocalLength[i] <= 0 || pos_check >= INT32_MAX - pLocalLength[i] || !DATA_POINTER_CHECK(pos_check)) 70 { 71 crError("crUnpackExtendShaderSource: pos %d is out of range", pos_check); 72 return; 73 } 74 75 pos_check += pLocalLength[i]; 76 } 77 78 ppStrings = crAlloc(count * sizeof(char*)); 58 79 if (!ppStrings) return; 59 80 60 for (i =0; i<count; ++i)81 for (i = 0; i < count; ++i) 61 82 { 62 83 ppStrings[i] = DATA_POINTER(pos, char);
Note:
See TracChangeset
for help on using the changeset viewer.