[gnome-remote-desktop] rdp/rdpgfx: Only clear unacked frames when surface has frame controller



commit afa20b4b57da2cb8ef3a83bc438dd6a97446c682
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Fri Aug 5 11:35:46 2022 +0200

    rdp/rdpgfx: Only clear unacked frames when surface has frame controller
    
    When a client suspends the frame acknowledgement, the Unacknowledged
    Frames ADM element MUST be cleared ([MS-RDPEGFX] 3.2.5.13).
    In gnome-remote-desktop, this also involves iterating through all GFX
    surfaces, getting their frame controller, and clear their frame logs.
    In some circumstances however, a GFX surface might have a different
    render surface due to encoder constraints.
    These render surfaces don't have their own frame controller.
    If a client suspends the frame acknowledgement and a separate render
    surface is present, gnome-remote-desktop crashes, as the suspend
    handling currently assumes, that all GFX surfaces have a frame
    controller, but this is not the case.
    
    Fix this situation by checking for the existence of the frame
    controller first, before trying to clear its frame log.
    
    Fixes: cc790574b45e4778f220c8916b26dee6622f7a5b
    Fixes: https://errors.ubuntu.com/problem/ecf34bd0b58c72cf2d1f03ba4222b71cc62e0d83

 src/grd-rdp-graphics-pipeline.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/grd-rdp-graphics-pipeline.c b/src/grd-rdp-graphics-pipeline.c
index 3b525e60..799bb4a2 100644
--- a/src/grd-rdp-graphics-pipeline.c
+++ b/src/grd-rdp-graphics-pipeline.c
@@ -1292,6 +1292,9 @@ clear_all_unacked_frames_in_gfx_surface (gpointer key,
   GrdRdpGfxFrameController *frame_controller =
     grd_rdp_gfx_surface_get_frame_controller (gfx_surface);
 
+  if (!frame_controller)
+    return;
+
   grd_rdp_gfx_frame_controller_clear_all_unacked_frames (frame_controller);
 }
 


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