wayland/screencopy: handle buffer creation failures
This commit is contained in:
parent
ab096b7e78
commit
91c9db581e
4 changed files with 30 additions and 0 deletions
|
|
@ -69,6 +69,11 @@ bool WlBufferManager::isReady() const { return this->p->mReady; }
|
|||
qCDebug(logBuffer) << " Format" << format;
|
||||
}
|
||||
|
||||
if (request.width == 0 || request.height == 0) {
|
||||
qCWarning(logBuffer) << "Cannot create zero-sized buffer.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!dmabufDisabled) {
|
||||
if (auto* buf = this->p->dmabuf.createDmabuf(request)) return buf;
|
||||
qCWarning(logBuffer) << "DMA buffer creation failed, falling back to SHM.";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue