From 2f0b322e721625def489f1dfaf9eb061e2eedb9a Mon Sep 17 00:00:00 2001 From: David Marcec Date: Wed, 24 Jun 2020 23:01:00 +1000 Subject: prepo: : Don't read extra buffer from report unless passed Prepo doesn't always pass a secondary buffer, we assume it always does which leads to a bad read. --- src/core/hle/service/prepo/prepo.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 14309c679..67833d9af 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp @@ -75,8 +75,13 @@ private: const auto user_id = rp.PopRaw(); const auto process_id = rp.PopRaw(); std::vector> data{ctx.ReadBuffer(0)}; + if constexpr (Type == Core::Reporter::PlayReportType::Old2) { - data.emplace_back(ctx.ReadBuffer(1)); + const auto read_buffer_count = + ctx.BufferDescriptorX().size() + ctx.BufferDescriptorA().size(); + if (read_buffer_count > 1) { + data.emplace_back(ctx.ReadBuffer(1)); + } } LOG_DEBUG( -- cgit v1.2.3