diff --git a/src/xrt/compositor/main/comp_target_swapchain.c b/src/xrt/compositor/main/comp_target_swapchain.c index b73a70b2c..24ab25d32 100644 --- a/src/xrt/compositor/main/comp_target_swapchain.c +++ b/src/xrt/compositor/main/comp_target_swapchain.c @@ -222,7 +222,7 @@ pick_first_matching_surface_format(const struct comp_target_create_images_info * for (uint32_t k = 0; k < surface_format_count; k++) { if (surface_formats[k].format == format) { // Perfect match. - *out_surface_format = surface_formats[i]; + *out_surface_format = surface_formats[k]; return true; } }