Skip to content

[scene] Fix segfault in KWin::WindowPixmap::shape

Lewis Lakerink requested to merge lakerink/kwin:master into master

From scene.h:-

    /**
     * @returns the surface this WindowPixmap references, might be @c null.
     */
    KWaylandServer::SurfaceInterface *surface() const;

There is a situation where subSurface() can return a non-null value, but surface() returns null. This MR just checks that surface() is defined before using it avoiding a segfault.

Reproducer:

  • Open Konsole (probably works with any window)
  • Right click the decoration and select "Configure Special Window Settings..."
  • Close the window specific settings dialog
  • kwin_wayland crashes.

BUG: 426567

Edited by Lewis Lakerink

Merge request reports