st/oxr: Return XR_ERROR_SWAPCHAIN_RECT_INVALID.

For out of bounds imageRect offsets on quad layers.
This commit is contained in:
Lubosz Sarnecki 2020-05-22 13:47:13 +02:00 committed by Jakob Bornecrantz
parent 1bad77efb4
commit b1541c2d1e

View file

@ -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;
}