diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-10-30 02:53:57 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-15 18:47:36 +0100 |
commit | 8aa17f0480db67a514d3fc33e729f96f961ddee3 (patch) | |
tree | d3fff49d44c4b96638e5d56fba9630eb93fe9b60 /src/core | |
parent | Merge pull request #1637 from FernandoS27/cache (diff) | |
download | yuzu-8aa17f0480db67a514d3fc33e729f96f961ddee3.tar yuzu-8aa17f0480db67a514d3fc33e729f96f961ddee3.tar.gz yuzu-8aa17f0480db67a514d3fc33e729f96f961ddee3.tar.bz2 yuzu-8aa17f0480db67a514d3fc33e729f96f961ddee3.tar.lz yuzu-8aa17f0480db67a514d3fc33e729f96f961ddee3.tar.xz yuzu-8aa17f0480db67a514d3fc33e729f96f961ddee3.tar.zst yuzu-8aa17f0480db67a514d3fc33e729f96f961ddee3.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/ns/pl_u.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index 44accecb7..1066bf505 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp @@ -351,6 +351,14 @@ void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) { 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_offsets, 1); ctx.WriteBuffer(font_sizes, 2); |