Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resize crash #3107

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Fix resize crash #3107

merged 2 commits into from
Jun 10, 2024

Commits on Jun 3, 2024

  1. Prevent SEGV when resizing with GFX

    The xrdp_enc_data contains a union for handling surface commands
    and gfx commands. Memory processing is different for these two
    options.
    
    The default destructor for the encoder FIFO only knows about surface
    commands. Consequently, if the encoder has queued GFX data when the
    encoder is closed, the destructor processes the queued data as if
    it contained surface commands rather than GFX commands. This typically
    causes a SEGV as the drects field of the overlaid surface command
    structure is not pointing at anything valid when it is freed.
    matt335672 committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    809df89 View commit details
    Browse the repository at this point in the history
  2. Add explicit object for the encoder finishing

    On a resize, the encoder is deleted. At present this is done by asking
    the encoder to exit, and then waiting a second.
    
    - On slower systems, a second may not be enough, and so the encoder
      data structures are freed while they are still being used by the
      encoder.
    - On quicker systems, resizes are delayed by hundreds of milliseconds
      longer than they need to be.
    
    This commit adds a wait object which the encoder can use to signal it
    has actually finished.
    matt335672 committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    985b0de View commit details
    Browse the repository at this point in the history