The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/oxr: Correctly validate time in xrLocateSpace

+12 -4
+1
doc/changes/state_trackers/mr.354.2.md
··· 1 + OpenXR: Correctly reject invalid times given to `xrLocateSpace`.
+11 -4
src/xrt/state_trackers/oxr/oxr_api_space.c
··· 7 7 * @ingroup oxr_api 8 8 */ 9 9 10 - #include <stdio.h> 11 - #include <stdlib.h> 12 - #include <string.h> 13 - 14 10 #include "xrt/xrt_compiler.h" 15 11 16 12 #include "math/m_api.h" ··· 22 18 23 19 #include "oxr_api_funcs.h" 24 20 #include "oxr_api_verify.h" 21 + 22 + #include <stdio.h> 23 + #include <stdlib.h> 24 + #include <string.h> 25 + #include <inttypes.h> 25 26 26 27 27 28 XrResult ··· 126 127 OXR_VERIFY_SPACE_NOT_NULL(&log, baseSpace, baseSpc); 127 128 OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(&log, location, 128 129 XR_TYPE_SPACE_LOCATION); 130 + 131 + if (time <= (XrTime)0) { 132 + return oxr_error(&log, XR_ERROR_TIME_INVALID, 133 + "(time == %" PRIi64 ") is not a valid time.", 134 + time); 135 + } 129 136 130 137 return oxr_space_locate(&log, spc, baseSpc, time, location); 131 138 }