Index: /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
===================================================================
--- /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp	(revision 81204)
+++ /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp	(revision 81205)
@@ -4758,4 +4758,5 @@
 
     Log(("vmsvga3dSetLightEnabled %x %d -> %d\n", cid, index, enabled));
+    AssertReturn(index < SVGA3D_MAX_LIGHTS, VERR_INVALID_PARAMETER);
 
     int rc = vmsvga3dContextFromCid(pState, cid, &pContext);
@@ -4763,8 +4764,5 @@
 
     /* Store for vm state save/restore */
-    if (index < SVGA3D_MAX_LIGHTS)
-        pContext->state.aLightData[index].fEnabled = !!enabled;
-    else
-        AssertFailed();
+    pContext->state.aLightData[index].fEnabled = !!enabled;
 
     hr = pContext->pDevice->LightEnable(index, (BOOL)enabled);
