From acb313631f66867535283e339402bb8d5886a65e Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Sat, 31 Dec 2022 16:40:47 +0100 Subject: [PATCH] device page: disable resize button if there are no zones I have an unsupported Asus GPU which shows up as a device but doesn't have any zone configured. Clicking on the Resize button leads to an out-of-bounds read in the empty `zones` vector to `zones[-1]` (default value of the QComboBox property). The fix is to entirely disable the button when we're disabling the zones box. --- qt/OpenRGBDevicePage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qt/OpenRGBDevicePage.cpp b/qt/OpenRGBDevicePage.cpp index e558aece..c53b80f1 100644 --- a/qt/OpenRGBDevicePage.cpp +++ b/qt/OpenRGBDevicePage.cpp @@ -703,6 +703,7 @@ void Ui::OpenRGBDevicePage::UpdateModeUi() else { ui->ZoneBox->setDisabled(1); + ui->ResizeButton->setEnabled(false); } for (std::size_t i = 0; i < device->zones.size(); i++)