VirtualBox

Ignore:
Timestamp:
Jul 18, 2018 8:07:50 PM (6 years ago)
Author:
vboxsync
Message:

3D: texture unpacking reworked, bugref:9192. Merged r123597, r123598, r123600, r123601, r123755.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        88/branches/VBox-5.0:104445,104938,104943,104950,104952-104953,104987-104988,104990,106453
        99/branches/VBox-5.1:112367,115992,116543,116550,116568,116573
        10 /branches/VBox-5.2:120083,120099,120213,120221,120239
         10/branches/VBox-5.2:120083,120099,120213,120221,120239,123597-123598,123600-123601,123755
        1111/branches/andy/draganddrop:90781-91268
        1212/branches/andy/guestctrl20:78916,78930
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        88/branches/VBox-5.0/src/VBox:104938,104943,104950,104987-104988,104990,106453
        99/branches/VBox-5.1/src/VBox:112367,116543,116550,116568,116573
        10 /branches/VBox-5.2/src/VBox:120083,120099,120213,120221,120239
         10/branches/VBox-5.2/src/VBox:120083,120099,120213,120221,120239,123597-123598,123600-123601,123755
        1111/branches/andy/draganddrop/src/VBox:90781-91268
        1212/branches/andy/guestctrl20/src/VBox:78916,78930
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c

    r69500 r73223  
    3737void SERVER_DISPATCH_APIENTRY crServerDispatchGetActiveAttrib(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, char *name)
    3838{
    39     crGetActive_t *pLocal;
    40 
    41     pLocal = (crGetActive_t*) crAlloc(bufSize+sizeof(crGetActive_t));
     39    crGetActive_t *pLocal = NULL;
     40
     41    if (bufSize < INT32_MAX / 2)
     42        pLocal = (crGetActive_t*)crAlloc(bufSize + sizeof(crGetActive_t));
     43
    4244    if (!pLocal)
    4345    {
     
    5658void SERVER_DISPATCH_APIENTRY crServerDispatchGetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, char *name)
    5759{
    58     crGetActive_t *pLocal;
    59 
    60     pLocal = (crGetActive_t*) crAlloc(bufSize+sizeof(crGetActive_t));
     60    crGetActive_t *pLocal = NULL;
     61
     62    if (bufSize < INT32_MAX / 2)
     63        pLocal = (crGetActive_t*) crAlloc(bufSize + sizeof(crGetActive_t));
     64
    6165    if (!pLocal)
    6266    {
     
    7579void SERVER_DISPATCH_APIENTRY crServerDispatchGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders)
    7680{
    77     GLsizei *pLocal;
    78 
    79     pLocal = (GLsizei*) crAlloc(maxCount*sizeof(GLuint)+sizeof(GLsizei));
     81    GLsizei *pLocal = NULL;
     82
     83    if (maxCount < INT32_MAX / sizeof(GLuint) / 2)
     84        pLocal = (GLsizei*) crAlloc(maxCount * sizeof(GLuint) + sizeof(GLsizei));
     85
    8086    if (!pLocal)
    8187    {
     
    102108void SERVER_DISPATCH_APIENTRY crServerDispatchGetAttachedObjectsARB(VBoxGLhandleARB containerObj, GLsizei maxCount, GLsizei * count, VBoxGLhandleARB * obj)
    103109{
    104     GLsizei *pLocal;
    105 
    106     pLocal = (GLsizei*) crAlloc(maxCount*sizeof(VBoxGLhandleARB)+sizeof(GLsizei));
     110    GLsizei *pLocal = NULL;
     111
     112    if (maxCount < INT32_MAX / sizeof(VBoxGLhandleARB) / 2)
     113        pLocal = (GLsizei*) crAlloc(maxCount * sizeof(VBoxGLhandleARB) + sizeof(GLsizei));
     114
    107115    if (!pLocal)
    108116    {
     
    131139void SERVER_DISPATCH_APIENTRY crServerDispatchGetInfoLogARB(VBoxGLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
    132140{
    133     GLsizei *pLocal;
     141    GLsizei *pLocal = NULL;
    134142    GLuint hwid;
    135143
    136     pLocal = (GLsizei*) crAlloc(maxLength+sizeof(GLsizei));
     144    if (maxLength < INT32_MAX / 2)
     145        pLocal = (GLsizei*) crAlloc(maxLength + sizeof(GLsizei));
     146
    137147    if (!pLocal)
    138148    {
     
    154164void SERVER_DISPATCH_APIENTRY crServerDispatchGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, char *infoLog)
    155165{
    156     GLsizei *pLocal;
    157 
    158     pLocal = (GLsizei*) crAlloc(bufSize+sizeof(GLsizei));
     166    GLsizei *pLocal = NULL;
     167
     168    if (bufSize < INT32_MAX / 2)
     169        pLocal = (GLsizei*) crAlloc(bufSize + sizeof(GLsizei));
     170
    159171    if (!pLocal)
    160172    {
     
    172184void SERVER_DISPATCH_APIENTRY crServerDispatchGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei *length, char *infoLog)
    173185{
    174     GLsizei *pLocal;
    175 
    176     pLocal = (GLsizei*) crAlloc(bufSize+sizeof(GLsizei));
     186    GLsizei *pLocal = NULL;
     187
     188    if (bufSize < INT32_MAX / 2)
     189        pLocal = (GLsizei*) crAlloc(bufSize + sizeof(GLsizei));
     190
    177191    if (!pLocal)
    178192    {
     
    191205void SERVER_DISPATCH_APIENTRY crServerDispatchGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length, char *source)
    192206{
    193     GLsizei *pLocal;
    194 
    195     pLocal = (GLsizei*) crAlloc(bufSize+sizeof(GLsizei));
     207    GLsizei *pLocal = NULL;
     208
     209    if (bufSize < INT32_MAX / 2)
     210        pLocal = (GLsizei*) crAlloc(bufSize + sizeof(GLsizei));
     211
    196212    if (!pLocal)
    197213    {
     
    211227crServerDispatchGetUniformsLocations(GLuint program, GLsizei maxcbData, GLsizei * cbData, GLvoid * pData)
    212228{
    213     GLsizei *pLocal;
     229    GLsizei *pLocal = NULL;
    214230
    215231    (void) cbData;
    216232    (void) pData;
    217233
    218     pLocal = (GLsizei*) crAlloc(maxcbData+sizeof(GLsizei));
     234    if (maxcbData < INT32_MAX / 2)
     235        pLocal = (GLsizei*) crAlloc(maxcbData + sizeof(GLsizei));
     236
    219237    if (!pLocal)
    220238    {
     
    235253crServerDispatchGetAttribsLocations(GLuint program, GLsizei maxcbData, GLsizei * cbData, GLvoid * pData)
    236254{
    237     GLsizei *pLocal;
     255    GLsizei *pLocal = NULL;
    238256
    239257    (void) cbData;
    240258    (void) pData;
    241259
    242     pLocal = (GLsizei*) crAlloc(maxcbData+sizeof(GLsizei));
     260    if (maxcbData < INT32_MAX / 2)
     261        pLocal = (GLsizei*) crAlloc(maxcbData + sizeof(GLsizei));
     262
    243263    if (!pLocal)
    244264    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette