Skip to content
Snippets Groups Projects
Commit 8aa17f04 authored by Zach Hilman's avatar Zach Hilman
Browse files

pl_u: Resize buffers in shared font data getter to what game requests

Fixes unmapped spam in SMP and buffer size errors in some other games
parent 8a537a20
No related branches found
No related tags found
No related merge requests found
...@@ -351,6 +351,14 @@ void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) { ...@@ -351,6 +351,14 @@ void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) {
font_sizes.push_back(region.size); font_sizes.push_back(region.size);
} }
// Resize buffers if game requests smaller size output.
font_codes.resize(
std::min<std::size_t>(font_codes.size(), ctx.GetWriteBufferSize(0) / sizeof(u32)));
font_offsets.resize(
std::min<std::size_t>(font_offsets.size(), ctx.GetWriteBufferSize(1) / sizeof(u32)));
font_sizes.resize(
std::min<std::size_t>(font_sizes.size(), ctx.GetWriteBufferSize(2) / sizeof(u32)));
ctx.WriteBuffer(font_codes, 0); ctx.WriteBuffer(font_codes, 0);
ctx.WriteBuffer(font_offsets, 1); ctx.WriteBuffer(font_offsets, 1);
ctx.WriteBuffer(font_sizes, 2); ctx.WriteBuffer(font_sizes, 2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment