VirtualBox

Changeset 79668 in vbox for trunk


Ignore:
Timestamp:
Jul 10, 2019 10:40:53 AM (6 years ago)
Author:
vboxsync
Message:

VMSVGA: Ignore requests to set invalid transform type or render state, bugref:9460

Location:
trunk/src/VBox/Devices/Graphics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r78593 r79668  
    3333#include <VBox/log.h>
    3434#include <VBox/vmm/pgm.h>
     35#include <VBox/AssertGuest.h>
    3536
    3637#include <iprt/assert.h>
     
    33423343        return VERR_INVALID_PARAMETER;
    33433344    }
     3345
     3346    ASSERT_GUEST_RETURN((unsigned)type < SVGA3D_TRANSFORM_MAX, VERR_INVALID_PARAMETER);
     3347
    33443348    pContext = pState->papContexts[cid];
    33453349    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
     
    35923596        return VERR_INVALID_PARAMETER;
    35933597    }
     3598
    35943599    pContext = pState->papContexts[cid];
    35953600    VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
     
    36003605        Log(("vmsvga3dSetRenderState: cid=%x state=%s (%d) val=%x\n", cid, vmsvga3dGetRenderStateName(pRenderState[i].state), pRenderState[i].state, pRenderState[i].uintValue));
    36013606        /* Save the render state for vm state saving. */
    3602         if (pRenderState[i].state < SVGA3D_RS_MAX)
    3603             pContext->state.aRenderState[pRenderState[i].state] = pRenderState[i];
     3607        ASSERT_GUEST_RETURN((unsigned)pRenderState[i].state < SVGA3D_RS_MAX, VERR_INVALID_PARAMETER);
     3608        pContext->state.aRenderState[pRenderState[i].state] = pRenderState[i];
    36043609
    36053610        switch (pRenderState[i].state)
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp

    r78589 r79668  
    2626#include <VBox/log.h>
    2727#include <VBox/vmm/pgm.h>
     28#include <VBox/AssertGuest.h>
    2829
    2930#include <iprt/assert.h>
     
    30543055    Log(("vmsvga3dSetTransform %x %s\n", cid, vmsvgaTransformToString(type)));
    30553056
     3057    ASSERT_GUEST_RETURN((unsigned)type < SVGA3D_TRANSFORM_MAX, VERR_INVALID_PARAMETER);
     3058
    30563059    if (    cid >= pState->cContexts
    30573060        ||  pState->papContexts[cid]->id != cid)
     
    32263229        Log(("vmsvga3dSetRenderState: state=%s (%d) val=%x\n", vmsvga3dGetRenderStateName(pRenderState[i].state), pRenderState[i].state, pRenderState[i].uintValue));
    32273230        /* Save the render state for vm state saving. */
    3228         if (pRenderState[i].state < SVGA3D_RS_MAX)
    3229             pContext->state.aRenderState[pRenderState[i].state] = pRenderState[i];
     3231        ASSERT_GUEST_RETURN((unsigned)pRenderState[i].state < SVGA3D_RS_MAX, VERR_INVALID_PARAMETER);
     3232        pContext->state.aRenderState[pRenderState[i].state] = pRenderState[i];
    32303233
    32313234        switch (pRenderState[i].state)
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