mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-12-22 11:39:49 +01:00
output: avoid crashing on no crtc (#58)
dual gpus can init with no crtc and later rescan for them, however getRenderFormats might be called before that happends and null ptr deref, guard against it.
This commit is contained in:
parent
b474796cdb
commit
b02d4f4d72
1 changed files with 4 additions and 0 deletions
|
@ -1718,6 +1718,10 @@ size_t Aquamarine::CDRMOutput::getGammaSize() {
|
|||
}
|
||||
|
||||
std::vector<SDRMFormat> Aquamarine::CDRMOutput::getRenderFormats() {
|
||||
if (!connector->crtc || !connector->crtc->primary || connector->crtc->primary->formats.empty()) {
|
||||
backend->log(AQ_LOG_ERROR, "Can't get formats: no crtc");
|
||||
return {};
|
||||
}
|
||||
return connector->crtc->primary->formats;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue