https://bugs.kde.org/show_bug.cgi?id=451086

nia1048...@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nia1048...@gmail.com

--- Comment #1 from nia1048...@gmail.com ---
I can confirm this issue too.

OS: Gentoo
krfb version: 21.12.3
window system: wayland

The problem lies in the screen size reported by VNC server to client. When a
VNC client connects to a VNC server, the server needs to tell the client its
desktop screen size.
My screen size is 1920x1080, but krfb reported 65535x65535 back to client,
causing the malloc error.

In fact, the width and height variable are not being set during the
initialization, they both remain value -1. The width and height are 16bit long
in VNC protocol, so krfb reported 65535x65535.

Use the following patch to output the width and height variable.

diff --git a/krfb/rfbservermanager.cpp b/krfb/rfbservermanager.cpp
index 0878f86..484b6e8 100644
--- a/krfb/rfbservermanager.cpp
+++ b/krfb/rfbservermanager.cpp
@@ -205,6 +205,7 @@ rfbScreenInfoPtr RfbServerManager::newScreen()
         //qDebug() << "bpp: " << bpp;

         rfbLogEnable(KRFB().isDebugEnabled());
+        qCDebug(KRFB) << "width: " << w << ", height: " << h;

         screen = rfbGetScreen(nullptr, nullptr, w, h, 8, 3, bpp);
         screen->paddedWidthInBytes = d->fb->paddedWidth();

The krfb's output:
 $ env LANG=C QT_LOGGING_RULES='krfb.*=true' krfb
QSocketNotifier: Can only be used with threads started with QThread
krfb.krfb: found plugin at 
"/usr/lib64/qt5/plugins/krfb/framebuffer/krfb_framebuffer_xcb.so"
krfb.krfb: Loaded plugin with name  "xcb"
krfb.krfb: found plugin at 
"/usr/lib64/qt5/plugins/krfb/framebuffer/krfb_framebuffer_qt.so"
krfb.krfb: Loaded plugin with name  "qt"
krfb.krfb: found plugin at 
"/usr/lib64/qt5/plugins/krfb/framebuffer/krfb_framebuffer_pw.so"
krfb.krfb: Loaded plugin with name  "pw"
krfb.krfb: Using FrameBuffer: "pw"
krfb.framebuffer.pipewire: Egl initialization succeeded
krfb.framebuffer.pipewire: "EGL version: 1.4"
Initializing D-Bus connectivity with XDG Desktop Portal
DBus session created: 
"/org/freedesktop/portal/desktop/request/1_150/krfb2361472498"
krfb.krfb: width:  -1 , height:  -1
09/05/2022 18:09:10 WARNING: Width (-1) is not a multiple of 4. VncViewer has
problems with that.
krfb.krfb: Starting server. Listen port: 5900 Listen Address: "0.0.0.0"
Password enabled: true
09/05/2022 18:09:10 Unable to establish connection with systemd socket
09/05/2022 18:09:10 Listening for VNC connections on TCP port 5900
09/05/2022 18:09:10 Listening for VNC connections on TCP6 port 5900
^C

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to