summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-07 19:25:56 +0100
committerGitHub <noreply@github.com>2021-02-07 19:25:56 +0100
commit230e71b255e60cdf1fa7d45773448c90d44671b5 (patch)
treed2b88e9215366502c004218199c21c4fb203e5b7 /src/core/hle/service
parentMerge pull request #5878 from aleasto/master (diff)
parentlm: Fix ReadLeb128 (diff)
downloadyuzu-230e71b255e60cdf1fa7d45773448c90d44671b5.tar
yuzu-230e71b255e60cdf1fa7d45773448c90d44671b5.tar.gz
yuzu-230e71b255e60cdf1fa7d45773448c90d44671b5.tar.bz2
yuzu-230e71b255e60cdf1fa7d45773448c90d44671b5.tar.lz
yuzu-230e71b255e60cdf1fa7d45773448c90d44671b5.tar.xz
yuzu-230e71b255e60cdf1fa7d45773448c90d44671b5.tar.zst
yuzu-230e71b255e60cdf1fa7d45773448c90d44671b5.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/lm/lm.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 2a6d43d2a..7d7542fc2 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -143,17 +143,19 @@ private:
rb.Push(RESULT_SUCCESS);
}
- u32 ReadLeb128(const std::vector<u8>& data, std::size_t& offset) {
- u32 result{};
+ u64 ReadLeb128(const std::vector<u8>& data, std::size_t& offset) {
+ u64 result{};
u32 shift{};
- do {
- result |= (data[offset] & 0x7f) << shift;
+
+ for (std::size_t i = 0; i < sizeof(u64); i++) {
+ const auto v = data[offset];
+ result |= (static_cast<u64>(v & 0x7f) << shift);
shift += 7;
offset++;
- if (offset >= data.size()) {
+ if (offset >= data.size() || ((v & 0x80) == 0)) {
break;
}
- } while ((data[offset] & 0x80) != 0);
+ }
return result;
}
@@ -262,7 +264,7 @@ private:
switch (entry.severity) {
case LogSeverity::Trace:
- LOG_DEBUG(Service_LM, "LogManager DEBUG ({}):\n{}", DestinationToString(destination),
+ LOG_DEBUG(Service_LM, "LogManager TRACE ({}):\n{}", DestinationToString(destination),
output_log);
break;
case LogSeverity::Info: