diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-02-07 00:18:47 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-02-07 00:18:47 +0000 |
| commit | f085ed4454fc0c9045b324c32f9ca34cd4c28808 (patch) | |
| tree | e300a7a0ba532c5f44e00330e2e135b14890316e /src/protocols/Screencopy.cpp | |
| parent | ded174d6e5d14bc376919194cbc52c238a07f640 (diff) | |
screencopy/toplevelexport: sanitize pointers in ::copyFrame
oopsie~~ >///<
Diffstat (limited to 'src/protocols/Screencopy.cpp')
| -rw-r--r-- | src/protocols/Screencopy.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index 18fe09f4..5f8c00d4 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -191,6 +191,13 @@ void CScreencopyProtocolManager::captureOutput(wl_client* client, wl_resource* r PFRAME->resource = wl_resource_create(client, &zwlr_screencopy_frame_v1_interface, wl_resource_get_version(resource), frame); PFRAME->pMonitor = g_pCompositor->getMonitorFromOutput(wlr_output_from_resource(output)); + if (!g_pCompositor->monitorExists(PFRAME->pMonitor)) { + Debug::log(ERR, "client requested sharing of a monitor that is gone"); + zwlr_screencopy_frame_v1_send_failed(PFRAME->resource); + removeFrame(PFRAME); + return; + } + if (!PFRAME->pMonitor) { Debug::log(ERR, "client requested sharing of a monitor that doesnt exist"); zwlr_screencopy_frame_v1_send_failed(PFRAME->resource); |
