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.
This commit is contained in:
Simon Chopin 2022-12-31 16:40:47 +01:00
parent b6172b71c8
commit acb313631f

View file

@ -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++)