Skip to content

Commit

Permalink
xcb: check validity of RandR output info before using it
Browse files Browse the repository at this point in the history
Fixes: QTBUG-128906
Pick-to: 6.8 6.7 6.5 6.2 5.15
Change-Id: Ibafdf4bb9c449b29437b0520299ab407238e5703
Reviewed-by: Tor Arne Vestbø <[email protected]>
  • Loading branch information
liangqi committed Sep 20, 2024
1 parent 1c9a785 commit 439e19b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/platforms/xcb/qxcbconnection_screens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 439e19b

Please sign in to comment.