Commit b3e9144c authored by Elena Zaretskaya's avatar Elena Zaretskaya
Browse files

Fix FPE under EGLFS_KMS if mesa-10.2.7


If mesa-10.2.7 is installed, gbm_bo_create returns NULL
(QEglFSKmsCursor ctor, qeglfskmscursor.cpp:80), but after
that the pointer m_bo is used in function QEGlFSKmsCursor::changeCursor
without verification.

Task-number: QTBUG-52404
Change-Id: I5b1b15d751e46a5200248e7a8642f7917dedd220
Reviewed-by: default avatarLaszlo Agocs <laszlo.agocs@theqtcompany.com>
Showing with 7 additions and 2 deletions
...@@ -100,8 +100,10 @@ QEglFSKmsCursor::~QEglFSKmsCursor() ...@@ -100,8 +100,10 @@ QEglFSKmsCursor::~QEglFSKmsCursor()
drmModeMoveCursor(kmsScreen->device()->fd(), kmsScreen->output().crtc_id, 0, 0); drmModeMoveCursor(kmsScreen->device()->fd(), kmsScreen->output().crtc_id, 0, 0);
} }
gbm_bo_destroy(m_bo); if (m_bo) {
m_bo = Q_NULLPTR; gbm_bo_destroy(m_bo);
m_bo = Q_NULLPTR;
}
} }
void QEglFSKmsCursor::pointerEvent(const QMouseEvent &event) void QEglFSKmsCursor::pointerEvent(const QMouseEvent &event)
...@@ -114,6 +116,9 @@ void QEglFSKmsCursor::changeCursor(QCursor *windowCursor, QWindow *window) ...@@ -114,6 +116,9 @@ void QEglFSKmsCursor::changeCursor(QCursor *windowCursor, QWindow *window)
{ {
Q_UNUSED(window); Q_UNUSED(window);
if (!m_bo)
return;
if (!m_visible) if (!m_visible)
return; return;
......
Supports Markdown
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