output: avoid crashing on no crtc
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
696a5ad4ec
commit
8fc0c549b7
|
|
@ -1713,6 +1713,10 @@ size_t Aquamarine::CDRMOutput::getGammaSize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<SDRMFormat> Aquamarine::CDRMOutput::getRenderFormats() {
|
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;
|
return connector->crtc->primary->formats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue