mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-25 17:21:54 -07:00
layershell: check if layer is valid (#9156)
fixes compositor crash when client tried to create a layer surface with invalid layer argument
This commit is contained in:
@@ -233,6 +233,11 @@ void CLayerShellProtocol::onGetLayerSurface(CZwlrLayerShellV1* pMgr, uint32_t id
|
||||
return;
|
||||
}
|
||||
|
||||
if UNLIKELY (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {
|
||||
pMgr->error(ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER, "Invalid layer");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto RESOURCE = m_vLayers.emplace_back(makeShared<CLayerShellResource>(makeShared<CZwlrLayerSurfaceV1>(CLIENT, pMgr->version(), id), SURF, namespace_, PMONITOR, layer));
|
||||
|
||||
if UNLIKELY (!RESOURCE->good()) {
|
||||
|
Reference in New Issue
Block a user