screencopy: fix nullptr deref if shm format is weird
This commit is contained in:
parent
f41e3c2203
commit
8ad96a95d6
1 changed files with 7 additions and 0 deletions
|
|
@ -87,6 +87,13 @@ CScreencopyFrame::CScreencopyFrame(SP<CZwlrScreencopyFrameV1> resource_, WP<CScr
|
|||
auto bufSize = m_frame->bufferSize();
|
||||
|
||||
const auto PSHMINFO = NFormatUtils::getPixelFormatFromDRM(format);
|
||||
|
||||
if (!PSHMINFO) {
|
||||
LOGM(Log::ERR, "No pixel format for drm format");
|
||||
m_resource->sendFailed();
|
||||
return;
|
||||
}
|
||||
|
||||
const auto stride = NFormatUtils::minStride(PSHMINFO, bufSize.x);
|
||||
m_resource->sendBuffer(NFormatUtils::drmToShm(format), bufSize.x, bufSize.y, stride);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue