From 11080322a0e60cccda7b9bab6ef79be71f77b9b6 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sat, 23 May 2020 12:17:34 +0200 Subject: [PATCH] Catch errors resizing framebuffer --- unix/xserver/hw/vnc/vncExtInit.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc index b87aefca..e2dd4eee 100644 --- a/unix/xserver/hw/vnc/vncExtInit.cc +++ b/unix/xserver/hw/vnc/vncExtInit.cc @@ -413,8 +413,13 @@ void vncPostScreenResize(int scrIdx, int success, int width, int height) { if (success) { // Let the RFB core know of the new dimensions and framebuffer - desktop[scrIdx]->setFramebuffer(width, height, - vncFbptr[scrIdx], vncFbstride[scrIdx]); + try { + desktop[scrIdx]->setFramebuffer(width, height, + vncFbptr[scrIdx], + vncFbstride[scrIdx]); + } catch (rdr::Exception& e) { + vncFatalError("vncPostScreenResize: %s\n", e.str()); + } } desktop[scrIdx]->unblockUpdates(); -- 2.39.5