The open source OpenXR runtime
0
fork

Configure Feed

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

ipc: Do not leak arguments before fully having waited

+15 -6
+15 -6
src/xrt/ipc/client/ipc_client_compositor.c
··· 517 517 IPC_TRACE_MARKER(); 518 518 struct ipc_client_compositor *icc = ipc_client_compositor(xc); 519 519 520 + int64_t frame_id = -1; 520 521 uint64_t wake_up_time_ns = 0; 522 + uint64_t predicted_display_time = 0; 523 + uint64_t predicted_display_period = 0; 521 524 522 - IPC_CALL_CHK(ipc_call_compositor_predict_frame(icc->ipc_c, // Connection 523 - out_frame_id, // Frame id 524 - &wake_up_time_ns, // When we should wake up 525 - out_predicted_display_time, // Display time 526 - out_predicted_display_period)); // Current period 525 + IPC_CALL_CHK(ipc_call_compositor_predict_frame( // 526 + icc->ipc_c, // Connection 527 + &frame_id, // Frame id 528 + &wake_up_time_ns, // When we should wake up 529 + &predicted_display_time, // Display time 530 + &predicted_display_period)); // Current period 527 531 528 532 // Wait until the given wake up time. 529 533 u_wait_until(&icc->sleeper, wake_up_time_ns); 530 534 531 535 // Signal that we woke up. 532 - res = ipc_call_compositor_wait_woke(icc->ipc_c, *out_frame_id); 536 + res = ipc_call_compositor_wait_woke(icc->ipc_c, frame_id); 537 + 538 + // Only write arguments once we have fully waited. 539 + *out_frame_id = frame_id; 540 + *out_predicted_display_time = predicted_display_time; 541 + *out_predicted_display_period = predicted_display_period; 533 542 534 543 return res; 535 544 }