summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbbackingstore.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-03-18 10:03:36 +0100
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-03-18 09:25:57 +0000
commitf64b87a5df8870be138dbf3febad950e1fc4ed8c (patch)
tree4cd011ed8269291cdd3015efd98db4a0e0551ff9 /src/plugins/platforms/xcb/qxcbbackingstore.cpp
parent45a0629a95cf91884dd05b45f5e636d948d858a2 (diff)
Fallback to malloc for insanely large windows
If shmget() does not work (probably because the backingstore size is bigger than SHMMAX), don't create a QImage with the previous buffer and the new size. That does not end well when we try to draw to the image later. Instead, fall back to the malloc path, like we do when the system doesn't support shared memory. [ChangeLog][X11] Don't crash when resizing windows to bigger than 3840x2160 Task-number: QTBUG-45071 Change-Id: I009de7c2179ffde28e252593067756877cad1b1c Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbbackingstore.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index f4382c7b50..42a868d997 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -122,7 +122,7 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
xcb_generic_error_t *error = NULL;
if (shm_present)
error = xcb_request_check(xcb_connection(), xcb_shm_attach_checked(xcb_connection(), m_shm_info.shmseg, m_shm_info.shmid, false));
- if (!shm_present || error) {
+ if (!shm_present || error || id == -1) {
free(error);
shmdt(m_shm_info.shmaddr);