mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-14 10:55:23 +00:00
st/oxr: Fix crash getting ref space bounds in headless mode
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2354>
This commit is contained in:
parent
e8074ec333
commit
0ca2ddd914
|
@ -186,6 +186,13 @@ oxr_space_get_reference_bounds_rect(struct oxr_logger *log,
|
||||||
|
|
||||||
enum xrt_reference_space_type reference_space_type = xr_ref_space_to_xrt(referenceSpaceType);
|
enum xrt_reference_space_type reference_space_type = xr_ref_space_to_xrt(referenceSpaceType);
|
||||||
|
|
||||||
|
if (xc == NULL) {
|
||||||
|
// Headless mode
|
||||||
|
// `bounds` must be set to 0 on XR_SPACE_BOUNDS_UNAVAILABLE
|
||||||
|
*bounds = (XrExtent2Df){0};
|
||||||
|
return XR_SPACE_BOUNDS_UNAVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
xrt_result_t xret = xrt_comp_get_reference_bounds_rect(xc, reference_space_type, (struct xrt_vec2 *)bounds);
|
xrt_result_t xret = xrt_comp_get_reference_bounds_rect(xc, reference_space_type, (struct xrt_vec2 *)bounds);
|
||||||
if (xret == XRT_SPACE_BOUNDS_UNAVAILABLE || xret == XRT_ERROR_NOT_IMPLEMENTED) {
|
if (xret == XRT_SPACE_BOUNDS_UNAVAILABLE || xret == XRT_ERROR_NOT_IMPLEMENTED) {
|
||||||
// `bounds` must be set to 0 on XR_SPACE_BOUNDS_UNAVAILABLE
|
// `bounds` must be set to 0 on XR_SPACE_BOUNDS_UNAVAILABLE
|
||||||
|
|
Loading…
Reference in a new issue