From 28014496c67eb7547f7df3821d07d7a2c32de661 Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Tue, 3 Mar 2020 12:13:45 +0800 Subject: [PATCH] Fix incorrect port_id use --- src/core/hle/service/cam/cam.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/cam/cam.cpp b/src/core/hle/service/cam/cam.cpp index 47076f50c..c5d24c314 100644 --- a/src/core/hle/service/cam/cam.cpp +++ b/src/core/hle/service/cam/cam.cpp @@ -901,9 +901,10 @@ void Module::Interface::GetLatestVsyncTiming(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 2); rb.Push(RESULT_SUCCESS); + const std::size_t port_id = port_select.m_val == 1 ? 0 : 1; std::vector out(count * sizeof(s64_le)); std::size_t offset = 0; - for (const s64_le timing : cam->ports[port_select.m_val].vsync_timings) { + for (const s64_le timing : cam->ports[port_id].vsync_timings) { std::memcpy(out.data() + offset * sizeof(timing), &timing, sizeof(timing)); offset++; if (offset >= count) {