Skip to content

vnc: Drop frames if client is gone

Frames from PipeWire are posted asynchronously from a I/O thread to the main thread where they are turned into VNC frame updates and cursor movements. On the other hand, sessions are closed asynchronously when the VNC client disappears. If a frame ended up on the main thread after a client disappeared but before the session and stream was closed, we'd try to turn the new frames into VNC updates without a client being available, causing use after free.

Fix this by dropping frames that happens during this time frame.

Closes: #43 (closed)


RDP doesn't have this issue as far as I can tell, since it checks rdp_peer_context->flags & RDP_PEER_ACTIVATED before handling the bits and pieces of the frame in grd-session-rdp.c.

Merge request reports