VirtualBox

Changeset 33045 in vbox


Ignore:
Timestamp:
Oct 11, 2010 4:57:21 PM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: fix GetObjectParameter[if]v accessing invalid shaders/programs

Location:
trunk/src/VBox
Files:
3 edited

Legend:

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

    r28800 r33045  
    163163
    164164    if (length) *length=*pLocal;
    165     crMemcpy(infoLog, &pLocal[1], (*pLocal)+1);
     165    crMemcpy(infoLog, &pLocal[1], (bufSize >= pLocal[0]) ? pLocal[0] : bufSize);
    166166    crFree(pLocal);
    167167}
     
    185185
    186186    if (length) *length=*pLocal;
    187     crMemcpy(infoLog, &pLocal[1], (*pLocal)+1);
     187    crMemcpy(infoLog, &pLocal[1], (bufSize >= pLocal[0]) ? pLocal[0] : bufSize);
    188188    crFree(pLocal);
    189189}
     
    207207
    208208    if (length) *length=*pLocal;
    209     crMemcpy(source, &pLocal[1], (*pLocal)+1);
    210     crFree(pLocal);
    211 }
     209    crMemcpy(source, &pLocal[1], (bufSize >= pLocal[0]) ? pLocal[0] : bufSize);
     210    crFree(pLocal);
     211}
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_getshaders.c

    r28800 r33045  
    144144    }
    145145    cr_server.head_spu->dispatch_table.GetShaderInfoLog(crStateGetShaderHWID(shader), bufSize, pLocal, (char*)&pLocal[1]);
    146     crServerReturnValue(pLocal, (*pLocal)+1+sizeof(GLsizei));
     146    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
    147147    crFree(pLocal);
    148148}
     
    159159    }
    160160    cr_server.head_spu->dispatch_table.GetProgramInfoLog(crStateGetProgramHWID(program), bufSize, pLocal, (char*)&pLocal[1]);
    161     crServerReturnValue(pLocal, (*pLocal)+1+sizeof(GLsizei));
     161    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
    162162    crFree(pLocal);
    163163}
     
    174174    }
    175175    cr_server.head_spu->dispatch_table.GetShaderSource(crStateGetShaderHWID(shader), bufSize, pLocal, (char*)&pLocal[1]);
    176     crServerReturnValue(pLocal, (*pLocal)+1+sizeof(GLsizei));
     176    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
    177177    crFree(pLocal);
    178178}
     
    280280}
    281281
     282void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterfvARB( GLhandleARB obj, GLenum pname, GLfloat * params )
     283{
     284    GLfloat local_params[1];
     285    GLuint hwid = crStateGetProgramHWID(obj);
     286    (void) params;
     287
     288    if (!hwid)
     289    {
     290        hwid = crStateGetShaderHWID(obj);
     291        if (!hwid)
     292        {
     293            crWarning("Unknown object %i, in crServerDispatchGetObjectParameterfvARB", obj);
     294        }
     295    }
     296
     297    cr_server.head_spu->dispatch_table.GetObjectParameterfvARB( hwid, pname, local_params );
     298    crServerReturnValue( &(local_params[0]), 1*sizeof(GLfloat) );
     299}
     300
     301void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterivARB( GLhandleARB obj, GLenum pname, GLint * params )
     302{
     303    GLint local_params[1];
     304    GLuint hwid = crStateGetProgramHWID(obj);
     305    if (!hwid)
     306    {
     307        hwid = crStateGetShaderHWID(obj);
     308        if (!hwid)
     309        {
     310            crWarning("Unknown object %i, in crServerDispatchGetObjectParameterivARB", obj);
     311        }
     312    }
     313
     314    (void) params;
     315    cr_server.head_spu->dispatch_table.GetObjectParameterivARB( hwid, pname, local_params );
     316    crServerReturnValue( &(local_params[0]), 1*sizeof(GLint) );
     317}
    282318#endif /* #ifdef CR_OPENGL_VERSION_2_0 */
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_special

    r32240 r33045  
    243243GetUniformLocation
    244244CopyTexSubImage2D
     245GetObjectParameterivARB
     246GetObjectParameterfvARB
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