VirtualBox

Changeset 82063 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Nov 21, 2019 7:45:53 AM (5 years ago)
Author:
vboxsync
Message:

Devices/Graphics: logrel unknown surface and context ids

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h

    r82003 r82063  
    12261226{
    12271227    /** @todo stricter checks for associated context */
    1228     if (   cid >= pState->cContexts
    1229         || pState->papContexts[cid]->id != cid)
     1228    AssertReturn(cid < pState->cContexts, VERR_INVALID_PARAMETER);
     1229    PVMSVGA3DCONTEXT const pContext = pState->papContexts[cid];
     1230    if (RT_LIKELY(pContext && pContext->id == cid))
    12301231    {
    1231         Log(("vmsvga3dSurfaceCopy invalid context id!\n"));
    1232         return VERR_INVALID_PARAMETER;
     1232        *ppContext = pContext;
     1233        return VINF_SUCCESS;
    12331234    }
    1234 
    1235     *ppContext = pState->papContexts[cid];
    1236     return VINF_SUCCESS;
     1235    LogRelMax(64, ("VMSVGA: unknown cid=%d (%s cid=%d)\n", cid, pContext ? "expected" : "null", pContext ? pContext->id : -1));
     1236    return VERR_INVALID_PARAMETER;
    12371237}
    12381238
    12391239DECLINLINE(int) vmsvga3dSurfaceFromSid(PVMSVGA3DSTATE pState, uint32_t sid, PVMSVGA3DSURFACE *ppSurface)
    12401240{
    1241     Assert(sid < SVGA3D_MAX_SURFACE_IDS);
    12421241    AssertReturn(sid < pState->cSurfaces, VERR_INVALID_PARAMETER);
    1243     PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid];
    1244     AssertReturn(pSurface && pSurface->id == sid, VERR_INVALID_PARAMETER);
    1245     *ppSurface = pSurface;
    1246     return VINF_SUCCESS;
     1242    PVMSVGA3DSURFACE const pSurface = pState->papSurfaces[sid];
     1243    if (RT_LIKELY(pSurface && pSurface->id == sid))
     1244    {
     1245        *ppSurface = pSurface;
     1246        return VINF_SUCCESS;
     1247    }
     1248    LogRelMax(64, ("VMSVGA: unknown sid=%d (%s sid=%d)\n", sid, pSurface ? "expected" : "null", pSurface ? pSurface->id : -1));
     1249    return VERR_INVALID_PARAMETER;
    12471250}
    12481251
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