From b1541c2d1ee74c11810683e12b145a9c33fc9fb2 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Fri, 22 May 2020 13:47:13 +0200 Subject: [PATCH] st/oxr: Return XR_ERROR_SWAPCHAIN_RECT_INVALID. For out of bounds imageRect offsets on quad layers. --- src/xrt/state_trackers/oxr/oxr_session.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xrt/state_trackers/oxr/oxr_session.c b/src/xrt/state_trackers/oxr/oxr_session.c index 16c10a634..582a8bb2d 100644 --- a/src/xrt/state_trackers/oxr/oxr_session.c +++ b/src/xrt/state_trackers/oxr/oxr_session.c @@ -496,6 +496,13 @@ verify_quad_layer(struct xrt_compositor *xc, layer_index); } + if (quad->subImage.imageRect.offset.x >= 1 || + quad->subImage.imageRect.offset.y >= 1) { + return oxr_error(log, XR_ERROR_SWAPCHAIN_RECT_INVALID, + "imageRect offset out of bounds for layer %u.", + layer_index); + } + return XR_SUCCESS; }