mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-22 23:43:50 -07:00
screencopy/toplevelexport: sanitize pointers in ::copyFrame
oopsie~~ >///<
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user