VirtualBox

Changeset 78790 in vbox for trunk/src


Ignore:
Timestamp:
May 27, 2019 7:07:49 PM (6 years ago)
Author:
vboxsync
Message:

GuestHost/OpenGL/state_tracker/state_lighting.c: Fixed parameter validation, Make sure only the GL_SHININESS gets accepted for glMaterialf() glMateriali() as per specification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_lighting.c

    r78375 r78790  
    737737void STATE_APIENTRY crStateMaterialf (PCRStateTracker pState, GLenum face, GLenum pname, GLfloat param)
    738738{
    739         crStateMaterialfv(pState, face, pname, &param);
     739    if (pname != GL_SHININESS)
     740    {
     741        crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM, "crStateMaterialf: bad pname: 0x%x", pname);
     742        return;
     743    }
     744    crStateMaterialfv(pState, face, pname, &param);
    740745}
    741746
    742747void STATE_APIENTRY crStateMateriali (PCRStateTracker pState, GLenum face, GLenum pname, GLint param)
    743748{
    744         GLfloat f_param = (GLfloat) param;
    745         crStateMaterialfv(pState, face, pname, &f_param);
     749    GLfloat f_param = (GLfloat) param;
     750
     751    if (pname != GL_SHININESS)
     752    {
     753        crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM, "crStateMateriali: bad pname: 0x%x", pname);
     754        return;
     755    }
     756
     757    crStateMaterialfv(pState, face, pname, &f_param);
    746758}
    747759
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