Index: /trunk/src/VBox/Additions/3D/win/VBoxGL/GaDrvEnvKMT.cpp
===================================================================
--- /trunk/src/VBox/Additions/3D/win/VBoxGL/GaDrvEnvKMT.cpp	(revision 79781)
+++ /trunk/src/VBox/Additions/3D/win/VBoxGL/GaDrvEnvKMT.cpp	(revision 79782)
@@ -386,6 +386,6 @@
     }
 
+    VBoxDispMpLoggerLogF("WDDM: EnvKMT: unsupported surface format %d\n", format);
     Assert(0);
-    VBoxDispMpLoggerLogF("WDDM: EnvKMT: unsupported surface format %d\n", format);
     return D3DDDIFMT_UNKNOWN;
 }
@@ -405,4 +405,9 @@
     uint8_t                          *pu8Req;
     uint32_t                          cbReq;
+
+    /* First check if the format is supported. */
+    D3DDDIFORMAT const ddiFormat = svgaToD3DDDIFormat((SVGA3dSurfaceFormat)pCreateParms->format);
+    if (ddiFormat == D3DDDIFMT_UNKNOWN)
+        return -1;
 
     /* Size of the SVGA request data */
@@ -459,5 +464,5 @@
                 wddmAllocInfo.SurfDesc.width      = paSizes[0].cWidth;
                 wddmAllocInfo.SurfDesc.height     = paSizes[0].cHeight;
-                wddmAllocInfo.SurfDesc.format     = svgaToD3DDDIFormat((SVGA3dSurfaceFormat)pCreateParms->format);
+                wddmAllocInfo.SurfDesc.format     = ddiFormat;
                 wddmAllocInfo.SurfDesc.VidPnSourceId = 0;
                 wddmAllocInfo.SurfDesc.bpp        = vboxWddmCalcBitsPerPixel(wddmAllocInfo.SurfDesc.format);
