--- VBoxVNC.cpp.orig	2017-03-16 03:17:09.000000000 +0800
+++ VBoxVNC.cpp	2017-03-24 10:57:12.381136918 +0800
@@ -820,6 +820,14 @@
             }
         }
 
+        if(!instance->mScreenBuffer) {
+            VRDEResize(hServer);
+            if(!instance->mScreenBuffer) {
+                LogRel(("VNCServerImpl::VRDEUpdate: Cannot get frame buffer"));
+                return;
+            }
+        }
+
         uint32_t width = instance->FrameInfo.cWidth;
         uint32_t bpp = instance->FrameInfo.cBitsPerPixel / 8;
         uint32_t joff = order->y * width + order->x;
