The open source OpenXR runtime
0
fork

Configure Feed

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

st/oxr: Check argument validity in time conversion function

Affected OpenXR functions: xrConvertWin32PerformanceCounterToTime

authored by

Christoph Haag and committed by
Jakob Bornecrantz
e61adde1 a4901bac

+7
+7
src/xrt/state_trackers/oxr/oxr_api_instance.c
··· 399 399 OXR_VERIFY_EXTENSION(&log, inst, KHR_win32_convert_performance_counter_time); 400 400 OXR_VERIFY_ARG_NOT_NULL(&log, performanceCounter); 401 401 OXR_VERIFY_ARG_NOT_NULL(&log, time); 402 + 403 + if (performanceCounter->QuadPart <= 0) { 404 + return oxr_error(&log, XR_ERROR_TIME_INVALID, 405 + "(time == %" PRIi64 ") is not a valid performance counter time.", 406 + performanceCounter->QuadPart); 407 + } 408 + 402 409 return oxr_instance_convert_win32perfcounter_to_time(&log, inst, performanceCounter, time); 403 410 } 404 411