screencopy: fix crash in invalid format reads

This commit is contained in:
vaxerski 2023-04-08 13:35:36 +01:00
parent 3ce19e67fe
commit 31963f823b

View file

@ -379,6 +379,7 @@ bool CScreencopyProtocolManager::copyFrameShm(SScreencopyFrame* frame, timespec*
const auto PFORMAT = get_gles2_format_from_drm(format); const auto PFORMAT = get_gles2_format_from_drm(format);
if (!PFORMAT) { if (!PFORMAT) {
Debug::log(ERR, "[screencopy] Cannot read pixels, unsupported format %x", PFORMAT); Debug::log(ERR, "[screencopy] Cannot read pixels, unsupported format %x", PFORMAT);
wlr_output_rollback(PMONITOR->output);
pixman_region32_fini(&fakeDamage); pixman_region32_fini(&fakeDamage);
wlr_buffer_end_data_ptr_access(frame->buffer); wlr_buffer_end_data_ptr_access(frame->buffer);
return false; return false;