[gnome-remote-desktop] vnc-pipewire-stream: Do not resize framebuffer when client is gone



commit e24981a6866372c9c80263d3ca12865e4f0684b6
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Fri Jan 21 02:12:02 2022 +0100

    vnc-pipewire-stream: Do not resize framebuffer when client is gone
    
    When the VNC client is gone, the local rfb_client pointer is set to
    NULL.
    Since VNC sessions are not directly stopped, other GSources can run
    before an idle GSource stops the session.
    Such GSource can be the pipewire_source. If a VNC client closes the
    connection after a stream is created, but before the framebuffer size
    is known, gnome-remote-desktop crash, when resizing the framebuffer, as
    rfb_client may already be NULL.
    
    To fix this situation, check whether the client is gone, before
    attempting to resize the framebuffer.
    
    Fixes: https://errors.ubuntu.com/problem/ab880706e8a266568463cc4869ad9234e25a7d3b
    
    https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/merge_requests/70

 src/grd-vnc-pipewire-stream.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/grd-vnc-pipewire-stream.c b/src/grd-vnc-pipewire-stream.c
index 5ed3ae9..19f0a8a 100644
--- a/src/grd-vnc-pipewire-stream.c
+++ b/src/grd-vnc-pipewire-stream.c
@@ -201,6 +201,9 @@ on_stream_param_changed (void                 *user_data,
   enum spa_data_type allowed_buffer_types;
   const struct spa_pod *params[3];
 
+  if (grd_session_vnc_is_client_gone (stream->session))
+    return;
+
   if (!format || id != SPA_PARAM_Format)
     return;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]