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: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
parent
b75e10684c
commit
b3e9144c3a
@ -100,8 +100,10 @@ QEglFSKmsCursor::~QEglFSKmsCursor()
|
||||
drmModeMoveCursor(kmsScreen->device()->fd(), kmsScreen->output().crtc_id, 0, 0);
|
||||
}
|
||||
|
||||
gbm_bo_destroy(m_bo);
|
||||
m_bo = Q_NULLPTR;
|
||||
if (m_bo) {
|
||||
gbm_bo_destroy(m_bo);
|
||||
m_bo = Q_NULLPTR;
|
||||
}
|
||||
}
|
||||
|
||||
void QEglFSKmsCursor::pointerEvent(const QMouseEvent &event)
|
||||
@ -114,6 +116,9 @@ void QEglFSKmsCursor::changeCursor(QCursor *windowCursor, QWindow *window)
|
||||
{
|
||||
Q_UNUSED(window);
|
||||
|
||||
if (!m_bo)
|
||||
return;
|
||||
|
||||
if (!m_visible)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user