wayland/screencopy: handle buffer creation failures

This commit is contained in:
outfoxxed 2025-07-26 00:48:21 -07:00
parent ab096b7e78
commit 91c9db581e
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 30 additions and 0 deletions

View file

@ -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.";