Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp	(revision 53323)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp	(revision 53324)
@@ -259,6 +259,16 @@
                         break;
 
+                    /* Make sure screen-data size is valid: */
+                    const int iExpectedSize = size.width() * size.height() * 4;
+                    const int iActualSize = screenData.size();
+                    if (iActualSize != iExpectedSize)
+                    {
+                        AssertMsgFailed(("Invalid screen-data size '%d', should be '%d'!\n", iActualSize, iExpectedSize));
+                        break;
+                    }
+
                     /* Create image based on shallow copy of acquired data: */
-                    image = QImage(screenData.data(), size.width(), size.height(), QImage::Format_RGB32);
+                    QImage tempImage(screenData.data(), size.width(), size.height(), QImage::Format_RGB32);
+                    image = tempImage;
                     /* And detach that copy to make it deep: */
                     image.detach();
