From 439e19be17b9169f5786b2593e6d1ac6978bb84b Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 16 Sep 2024 11:14:15 +0200 Subject: [PATCH] xcb: check validity of RandR output info before using it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-128906 Pick-to: 6.8 6.7 6.5 6.2 5.15 Change-Id: Ibafdf4bb9c449b29437b0520299ab407238e5703 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/xcb/qxcbconnection_screens.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp index c31e9b10390..3dbb8835422 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp @@ -140,7 +140,7 @@ void QXcbConnection::updateScreens(const xcb_randr_notify_event_t *event) // Screen has been disabled auto outputInfo = Q_XCB_REPLY(xcb_randr_get_output_info, xcb_connection(), output.output, output.config_timestamp); - if (outputInfo->crtc == XCB_NONE) { + if (!outputInfo || outputInfo->crtc == XCB_NONE) { qCDebug(lcQpaScreen) << "output" << screen->name() << "has been disabled"; destroyScreen(screen); } else {