summaryrefslogtreecommitdiff
path: root/src/hardwareintegration
diff options
context:
space:
mode:
authorOlivier Blin <olivier.blin@softathome.com>2014-05-21 15:37:43 +0200
committerOlivier Blin <qt@blino.org>2015-06-12 09:52:21 +0000
commite8904251a8758c11ae8fa9b9f7adcd575833f23a (patch)
tree44f7e8ee80ade454be715beb1a0c0e2b9538650f /src/hardwareintegration
parentad9bd8f672f623da9206aa8cef83b8ef50b49836 (diff)
downloadqtwayland-e8904251a8758c11ae8fa9b9f7adcd575833f23a.tar.gz
Fix crash when resizing a window in brcm-egl
This occurs for example when a Qt Quick2 application calls showFullScreen() while a rendering is already in progress. The GUI thread was calling destroyEglSurfaces() from setGeometry() and thus destroying the buffers, while the render thread was trying to use the buffers from swapBuffers(). There was a division by zero in swapBuffers() with the modulo m_count operation, because EGL surfaces were destroyed and m_count was 0. This fix is quite fragile, proper locking on buffers would be better. Change-Id: I41fcb2fcebec84c0dfc82ce56c6e323d3722b30a Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/hardwareintegration')
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
index 3d3fdad2..7cead1dc 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
@@ -243,6 +243,9 @@ void QWaylandBrcmEglWindow::swapBuffers()
glFinish();
}
+ if (!m_count)
+ return;
+
m_buffers[m_current]->bind();
attach(m_buffers[m_current], 0, 0);
damage(QRect(QPoint(), geometry().size()));