VirtualBox

Changeset 40479 in vbox for trunk


Ignore:
Timestamp:
Mar 15, 2012 2:16:50 PM (13 years ago)
Author:
vboxsync
Message:

crOpenGL: build log bugfix

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_getshaders.c

    r37157 r40479  
    2222#include "packspu_proto.h"
    2323#include "cr_mem.h"
     24#include <iprt/assert.h>
    2425
    2526/*@todo combine with the one from server_getshaders.c*/
     
    123124}
    124125
     126AssertCompile(sizeof(GLsizei) == 4);
     127
    125128void PACKSPU_APIENTRY packspu_GetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
    126129{
     
    140143        crNetRecv();
    141144
    142     if (length) *length=*pLocal;
    143     crMemcpy(infoLog, &pLocal[1], (*pLocal)+1);
     145    CRASSERT((pLocal[0]) <= maxLength);
     146
     147    if (length) *length=*pLocal;
     148    crMemcpy(infoLog, &pLocal[1], (maxLength >= (pLocal[0])) ? pLocal[0] : maxLength);
    144149    crFree(pLocal);
    145150}
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c

    r40167 r40479  
    2525#include "server.h"
    2626
     27#include <iprt/assert.h>
     28
    2729#ifdef CR_OPENGL_VERSION_2_0
    2830
     
    114116}
    115117
     118AssertCompile(sizeof(GLsizei) == 4);
     119
    116120void SERVER_DISPATCH_APIENTRY crServerDispatchGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
    117121{
     
    129133    if (!hwid) hwid = crStateGetShaderHWID(obj);
    130134    cr_server.head_spu->dispatch_table.GetInfoLogARB(hwid, maxLength, pLocal, (char*)&pLocal[1]);
     135    CRASSERT((*pLocal) <= maxLength);
    131136    crServerReturnValue(pLocal, (*pLocal)+sizeof(GLsizei));
    132137    crFree(pLocal);
     
    159164    }
    160165    cr_server.head_spu->dispatch_table.GetProgramInfoLog(crStateGetProgramHWID(program), bufSize, pLocal, (char*)&pLocal[1]);
     166    CRASSERT(pLocal[0] <= bufSize);
    161167    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
    162168    crFree(pLocal);
     
    174180    }
    175181    cr_server.head_spu->dispatch_table.GetShaderSource(crStateGetShaderHWID(shader), bufSize, pLocal, (char*)&pLocal[1]);
     182    CRASSERT(pLocal[0] <= bufSize);
    176183    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
    177184    crFree(pLocal);
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