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
|
|
@ -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 New Issue