diff options
| author | 2021-04-07 23:34:14 -0400 | |
|---|---|---|
| committer | 2021-04-07 23:34:14 -0400 | |
| commit | 28d3661a5cd98e3a1e7e18cda8cf9e4b0d2ae555 (patch) | |
| tree | db7d4198d75ba3eed6b1253f8a0d524420f7fac4 | |
| parent | Merge pull request #6143 from lat9nq/nvhost_null_memcpy (diff) | |
| download | yuzu-28d3661a5cd98e3a1e7e18cda8cf9e4b0d2ae555.tar.gz yuzu-28d3661a5cd98e3a1e7e18cda8cf9e4b0d2ae555.tar.xz yuzu-28d3661a5cd98e3a1e7e18cda8cf9e4b0d2ae555.zip | |
service: time: Fix CalculateStandardUserSystemClockDifferenceByUser
CalculateStandardUserSystemClockDifferenceByUser passes in the ClockSnapshots through 2 input buffers and not as raw arguments. Fix this by reading the 2 input buffers instead of popping raw arguments.
| -rw-r--r-- | src/core/hle/service/time/time.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 78543688f..f6ff39789 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp | |||
| @@ -321,9 +321,14 @@ void Module::Interface::CalculateStandardUserSystemClockDifferenceByUser( | |||
| 321 | Kernel::HLERequestContext& ctx) { | 321 | Kernel::HLERequestContext& ctx) { |
| 322 | LOG_DEBUG(Service_Time, "called"); | 322 | LOG_DEBUG(Service_Time, "called"); |
| 323 | 323 | ||
| 324 | IPC::RequestParser rp{ctx}; | 324 | Clock::ClockSnapshot snapshot_a; |
| 325 | const auto snapshot_a = rp.PopRaw<Clock::ClockSnapshot>(); | 325 | Clock::ClockSnapshot snapshot_b; |
| 326 | const auto snapshot_b = rp.PopRaw<Clock::ClockSnapshot>(); | 326 | |
| 327 | const auto snapshot_a_data = ctx.ReadBuffer(0); | ||
| 328 | const auto snapshot_b_data = ctx.ReadBuffer(1); | ||
| 329 | |||
| 330 | std::memcpy(&snapshot_a, snapshot_a_data.data(), sizeof(Clock::ClockSnapshot)); | ||
| 331 | std::memcpy(&snapshot_b, snapshot_b_data.data(), sizeof(Clock::ClockSnapshot)); | ||
| 327 | 332 | ||
| 328 | auto time_span_type{Clock::TimeSpanType::FromSeconds(snapshot_b.user_context.offset - | 333 | auto time_span_type{Clock::TimeSpanType::FromSeconds(snapshot_b.user_context.offset - |
| 329 | snapshot_a.user_context.offset)}; | 334 | snapshot_a.user_context.offset)}; |