0

Prevent overflow of OpenXrRenderLoop::next_frame_id_

Bug: 403313554
Change-Id: I73ec438eab85051616cea37b6f4a5a4d4939be64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6354764
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Commit-Queue: Piotr Bialecki <bialpio@chromium.org>
Reviewed-by: Piotr Bialecki <bialpio@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1432429}
This commit is contained in:
Alexander Cooper
2025-03-13 15:58:09 -07:00
committed by Chromium LUCI CQ
parent a62f1758ea
commit 669baea695

@ -193,9 +193,10 @@ void OpenXrRenderLoop::GetFrameData(
base::Unretained(this), std::move(callback),
std::move(pending_frame_->frame_data_)));
next_frame_id_ += 1;
if (next_frame_id_ < 0) {
if (next_frame_id_ == std::numeric_limits<int16_t>::max()) {
next_frame_id_ = 0;
} else {
next_frame_id_++;
}
}