VirtualBox

Changeset 83620 in vbox for trunk/src


Ignore:
Timestamp:
Apr 8, 2020 12:41:52 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137041
Message:

Devices/Graphics: check the resource type, step 2. bugref:9709

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

Legend:

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

    r83579 r83620  
    518518    union
    519519    {
    520         IDirect3DSurface9          *pSurface;
    521520        IDirect3DTexture9          *pTexture;
    522521        IDirect3DCubeTexture9      *pCubeTexture;
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp

    r83596 r83620  
    40704070        {
    40714071            Assert(pRenderTarget->idAssociatedContext == cid);
     4072            AssertReturn(pRenderTarget->enmD3DResType == VMSVGA3D_D3DRESTYPE_SURFACE, VERR_INVALID_PARAMETER);
    40724073            hr = pContext->pDevice->SetDepthStencilSurface(pRenderTarget->u.pSurface);
    40734074            AssertMsgReturn(hr == D3D_OK, ("SetDepthStencilSurface failed with %x\n", hr), VERR_INTERNAL_ERROR);
     
    41454146
    41464147            Assert(pRenderTarget->idAssociatedContext == cid);
    4147             Assert(pRenderTarget->enmD3DResType == VMSVGA3D_D3DRESTYPE_SURFACE);
     4148            AssertMsgReturn(pRenderTarget->enmD3DResType == VMSVGA3D_D3DRESTYPE_SURFACE,
     4149                            ("Invalid render target %#x\n", pRenderTarget->enmD3DResType),
     4150                            VERR_INVALID_PARAMETER);
    41484151            pSurface = pRenderTarget->u.pSurface;
    41494152        }
    41504153
    4151         AssertReturn(pRenderTarget->u.pSurface, VERR_INVALID_PARAMETER);
     4154        AssertReturn(pSurface, VERR_INVALID_PARAMETER);
    41524155        Assert(!pRenderTarget->fDirty);
    41534156
     
    43574360                else
    43584361                {
    4359                     Assert(   pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_TEXTURE
    4360                            || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_CUBE_TEXTURE
    4361                            || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_VOLUME_TEXTURE);
    43624362                    /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */
    43634363                    vmsvga3dSurfaceFlush(pSurface);
    43644364                }
     4365
     4366                AssertReturn(   pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_TEXTURE
     4367                             || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_CUBE_TEXTURE
     4368                             || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_VOLUME_TEXTURE,
     4369                             VERR_INVALID_PARAMETER);
    43654370
    43664371#ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette