VirtualBox

Ignore:
Timestamp:
Apr 10, 2019 8:01:12 PM (6 years ago)
Author:
vboxsync
Message:

GuestHost/OpenGL,HostServices/SharedOpenGL: Updates bugref:9407

Location:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter/server_presenter.cpp

    r76553 r78105  
    146146static int8_t crFbImgFromDimOffVramBGRA(VBOXCMDVBVAOFFSET offVRAM, uint32_t width, uint32_t height, CR_BLITTER_IMG *pImg)
    147147{
    148     uint32_t cbBuff = width * height * 4;
     148    uint32_t cbBuff;
     149   
     150    if (width == 0 || height == 0)
     151    {
     152        WARN(("invalid param"));
     153        return -1;
     154    }
     155   
     156    cbBuff = width * height * 4;
     157    // Check if overflow happened
     158    if (cbBuff / width != height * 4)
     159    {
     160        WARN(("invalid param"));
     161        return -1;
     162    }
     163   
    149164    if (offVRAM >= g_cbVRam
     165            || UINT32_MAX - cbBuff <= offVRAM
    150166            || offVRAM + cbBuff >= g_cbVRam)
    151167    {
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_get.py

    r78078 r78105  
    4949    'GetProgramParameterfvNV': 4,
    5050    'GetProgramivNV': 1,
    51     'GetTrackMatrixivNV': 1,
     51    'GetTrackMatrixivNV': 24,
    5252    'GetVertexAttribPointervNV': 1,
    5353    'GetVertexAttribdvNV': 4,
     
    127127        local_argname = 'local_%s' % lastParam[0]
    128128
    129         print('\tunsigned int cComponents = 0;');
     129        if not func_name in no_pnames:
     130            print('\tunsigned int cComponents = 0;');
    130131        print('\t%s %s[%d] = { 0 };' % ( local_argtype, local_argname, max_components[func_name] ))
    131132        print('\t(void) %s;' % lastParam[0])
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getpixelmap.c

    r69390 r78105  
    8080
    8181        size *= tabsize;
    82         local_values = (GLfloat*)crAlloc( size );
     82        local_values = (GLfloat*)crCalloc( size );
    8383
    8484        cr_server.head_spu->dispatch_table.GetPixelMapfv( map, local_values );
     
    107107
    108108        size *= tabsize;
    109         local_values = (GLuint*)crAlloc( size );
     109        local_values = (GLuint*)crCalloc( size );
    110110
    111111        cr_server.head_spu->dispatch_table.GetPixelMapuiv( map, local_values );
     
    134134
    135135        size *= tabsize;
    136         local_values = (GLushort*)crAlloc( size );
     136        local_values = (GLushort*)crCalloc( size );
    137137
    138138        cr_server.head_spu->dispatch_table.GetPixelMapusv( map, local_values );
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c

    r76787 r78105  
    359359void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterfvARB( VBoxGLhandleARB obj, GLenum pname, GLfloat * params )
    360360{
    361     GLfloat local_params[1];
     361    GLfloat local_params[1] = {0};
    362362    GLuint hwid = crStateGetProgramHWID(obj);
    363363    (void) params;
     
    378378void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterivARB( VBoxGLhandleARB obj, GLenum pname, GLint * params )
    379379{
    380     GLint local_params[1];
     380    GLint local_params[1] = {0};
    381381    GLuint hwid = crStateGetProgramHWID(obj);
    382382    if (!hwid)
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_glsl.c

    r76787 r78105  
    151151void SERVER_DISPATCH_APIENTRY crServerDispatchGetProgramiv( GLuint program, GLenum pname, GLint * params )
    152152{
    153     GLint local_params[1];
     153    GLint local_params[1] = {0};
    154154    (void) params;
    155155    cr_server.head_spu->dispatch_table.GetProgramiv(crStateGetProgramHWID(program), pname, local_params);
     
    159159void SERVER_DISPATCH_APIENTRY crServerDispatchGetShaderiv( GLuint shader, GLenum pname, GLint * params )
    160160{
    161     GLint local_params[1];
     161    GLint local_params[1] = {0};
    162162    (void) params;
    163163    cr_server.head_spu->dispatch_table.GetShaderiv( crStateGetShaderHWID(shader), pname, local_params );
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_papi.c

    r69390 r78105  
    3232        cr_server.head_spu->dispatch_table.ChromiumParametervCR( GL_PRINT_STRING_CR, GL_UNSIGNED_BYTE, sizeof(debug_buf), debug_buf );
    3333#endif
     34
     35        if (count > CR_MAX_CLIENTS)
     36                count = CR_MAX_CLIENTS;
     37
    3438        if (count == 0)
    3539        {
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