Index: /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h
===================================================================
--- /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h	(revision 83619)
+++ /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h	(revision 83620)
@@ -518,5 +518,4 @@
     union
     {
-        IDirect3DSurface9          *pSurface;
         IDirect3DTexture9          *pTexture;
         IDirect3DCubeTexture9      *pCubeTexture;
Index: /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
===================================================================
--- /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp	(revision 83619)
+++ /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp	(revision 83620)
@@ -4070,4 +4070,5 @@
         {
             Assert(pRenderTarget->idAssociatedContext == cid);
+            AssertReturn(pRenderTarget->enmD3DResType == VMSVGA3D_D3DRESTYPE_SURFACE, VERR_INVALID_PARAMETER);
             hr = pContext->pDevice->SetDepthStencilSurface(pRenderTarget->u.pSurface);
             AssertMsgReturn(hr == D3D_OK, ("SetDepthStencilSurface failed with %x\n", hr), VERR_INTERNAL_ERROR);
@@ -4145,9 +4146,11 @@
 
             Assert(pRenderTarget->idAssociatedContext == cid);
-            Assert(pRenderTarget->enmD3DResType == VMSVGA3D_D3DRESTYPE_SURFACE);
+            AssertMsgReturn(pRenderTarget->enmD3DResType == VMSVGA3D_D3DRESTYPE_SURFACE,
+                            ("Invalid render target %#x\n", pRenderTarget->enmD3DResType),
+                            VERR_INVALID_PARAMETER);
             pSurface = pRenderTarget->u.pSurface;
         }
 
-        AssertReturn(pRenderTarget->u.pSurface, VERR_INVALID_PARAMETER);
+        AssertReturn(pSurface, VERR_INVALID_PARAMETER);
         Assert(!pRenderTarget->fDirty);
 
@@ -4357,10 +4360,12 @@
                 else
                 {
-                    Assert(   pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_TEXTURE
-                           || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_CUBE_TEXTURE
-                           || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_VOLUME_TEXTURE);
                     /* Must flush the other context's 3d pipeline to make sure all drawing is complete for the surface we're about to use. */
                     vmsvga3dSurfaceFlush(pSurface);
                 }
+
+                AssertReturn(   pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_TEXTURE
+                             || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_CUBE_TEXTURE
+                             || pSurface->enmD3DResType == VMSVGA3D_D3DRESTYPE_VOLUME_TEXTURE,
+                             VERR_INVALID_PARAMETER);
 
 #ifndef VBOX_VMSVGA3D_WITH_WINE_OPENGL
