mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-25 07:09:48 +01:00
fix nullptr deref
This commit is contained in:
parent
c7e4f24c45
commit
93c35602ca
1 changed files with 4 additions and 1 deletions
|
@ -793,9 +793,12 @@ bool CMonitorState::test() {
|
||||||
bool CMonitorState::updateSwapchain() {
|
bool CMonitorState::updateSwapchain() {
|
||||||
auto options = m_pOwner->output->swapchain->currentOptions();
|
auto options = m_pOwner->output->swapchain->currentOptions();
|
||||||
const auto& STATE = m_pOwner->output->state->state();
|
const auto& STATE = m_pOwner->output->state->state();
|
||||||
|
const auto& MODE = STATE.mode ? STATE.mode : STATE.customMode;
|
||||||
|
if (!MODE)
|
||||||
|
return true;
|
||||||
options.format = STATE.drmFormat;
|
options.format = STATE.drmFormat;
|
||||||
options.scanout = true;
|
options.scanout = true;
|
||||||
options.length = 2;
|
options.length = 2;
|
||||||
options.size = STATE.mode ? STATE.mode->pixelSize : STATE.customMode->pixelSize;
|
options.size = MODE->pixelSize;
|
||||||
return m_pOwner->output->swapchain->reconfigure(options);
|
return m_pOwner->output->swapchain->reconfigure(options);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue