Commit 7804eb41 authored by Fabian Vogt's avatar Fabian Vogt

Fix crash due to dangling reference

Returning a reference to a value on the stack is broken.
This caused kwin_wayland to crash in openQA with a nullptr deref.

BUG: 407199

Test Plan: Only build tested.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision:
parent ee606536
......@@ -144,7 +144,7 @@ int orientationToRotation(Qt::ScreenOrientation orientation)
return 0;
QMatrix4x4 &&DrmOutput::matrixDisplay(const QSize &s) const
QMatrix4x4 DrmOutput::matrixDisplay(const QSize &s) const
QMatrix4x4 matrix;
const int angle = orientationToRotation(orientation());
......@@ -156,7 +156,7 @@ QMatrix4x4 &&DrmOutput::matrixDisplay(const QSize &s) const
matrix.translate(-center.width(), -center.height());
return std::move(matrix);
return matrix;
void DrmOutput::updateCursor()
......@@ -135,7 +135,7 @@ private:
int getGammaRampSize() const override;
bool setGammaRamp(const ColorCorrect::GammaRamp &gamma) override;
QMatrix4x4 &&matrixDisplay(const QSize &s) const;
QMatrix4x4 matrixDisplay(const QSize &s) const;
DrmBackend *m_backend;
DrmConnector *m_conn = nullptr;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment