--- src/VBox/Devices/Graphics/DevVGA.cpp.orig	2010-02-12 22:48:12.000000000 +0300
+++ src/VBox/Devices/Graphics/DevVGA.cpp	2010-03-15 10:43:10.189226010 +0300
@@ -4973,6 +4973,8 @@
      */
     updateDisplayAll(pThis);
 
+    if (pThis->last_scr_width && pThis->last_scr_height)
+    {
     /*
      * The display connector interface is temporarily replaced with the fake one.
      */
@@ -5038,10 +5040,19 @@
             *pcy = Connector.cy;
         }
     }
+    }
+    else
+    {
+        rc = VINF_SUCCESS;
+        *ppu8Data = NULL;
+        *pcbData = 0;
+        *pcx = 0;
+        *pcy = 0;
+    }
 
     PDMCritSectLeave(&pThis->lock);
 
-    LogFlow(("vgaPortTakeScreenshot: returns %Rrc (cbData=%d cx=%d cy=%d)\n", rc, cbRequired, Connector.cx, Connector.cy));
+    LogFlow(("vgaPortTakeScreenshot: returns %Rrc (cbData=%d cx=%d cy=%d)\n", rc, *pcbData, *pcx, *pcy));
     return rc;
 }
 
--- src/VBox/Main/DisplayImpl.cpp.orig	2010-02-12 22:49:23.000000000 +0300
+++ src/VBox/Main/DisplayImpl.cpp	2010-03-15 10:17:24.303396897 +0300
@@ -432,9 +432,11 @@
 
         if (RT_SUCCESS(rc))
         {
+	    if (cx && cy) {
             /* Prepare a small thumbnail and a PNG screenshot. */
             displayMakeThumbnail(pu8Data, cx, cy, &pu8Thumbnail, &cbThumbnail, &cxThumbnail, &cyThumbnail);
             displayMakePNG(pu8Data, cx, cy, &pu8PNG, &cbPNG, &cxPNG, &cyPNG);
+            }
 
             /* This can be called from any thread. */
             that->mpDrv->pUpPort->pfnFreeScreenshot (that->mpDrv->pUpPort, pu8Data);
