st/oxr: Correctly validate time in xrLocateSpace

This commit is contained in:
Jakob Bornecrantz committed 2020-05-28 22:56:59 +01:00
1 parent dd04379209
commit 03f802de77
2 files changed
+12 -4

No files matched your search

+1
View File
@@ -0,0 +1 @@
OpenXR: Correctly reject invalid times given to `xrLocateSpace`.
+11 -4
View File
@@ -7,10 +7,6 @@
* @ingroup oxr_api
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "xrt/xrt_compiler.h"
#include "math/m_api.h"
@@ -23,6 +19,11 @@
#include "oxr_api_funcs.h"
#include "oxr_api_verify.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
XrResult
oxr_xrCreateActionSpace(XrSession session,
@@ -127,6 +128,12 @@ oxr_xrLocateSpace(XrSpace space,
OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(&log, location,
XR_TYPE_SPACE_LOCATION);
if (time <= (XrTime)0) {
return oxr_error(&log, XR_ERROR_TIME_INVALID,
"(time == %" PRIi64 ") is not a valid time.",
time);
}
return oxr_space_locate(&log, spc, baseSpc, time, location);
}