From 1911f853918669f3258259b51ebc3dac19ed61ef Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Mon, 23 Sep 2019 09:52:49 -0400 Subject: pl_u: Fix mismatched rebase size error in font encryption --- src/core/file_sys/system_archive/shared_font.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/system_archive/shared_font.cpp b/src/core/file_sys/system_archive/shared_font.cpp index 5bb596824..2c05eb42e 100644 --- a/src/core/file_sys/system_archive/shared_font.cpp +++ b/src/core/file_sys/system_archive/shared_font.cpp @@ -18,16 +18,14 @@ namespace { template VirtualFile PackBFTTF(const std::array& data, const std::string& name) { - std::vector vec(Size); - std::memcpy(vec.data(), data.data(), vec.size()); + std::vector vec(Size / sizeof(u32)); + std::memcpy(vec.data(), data.data(), vec.size() * sizeof(u32)); - Kernel::PhysicalMemory bfttf(Size + sizeof(u64)); + std::vector bfttf(Size + sizeof(u64)); - Service::NS::EncryptSharedFont(vec, bfttf); - - std::vector bfttf_vec(Size + sizeof(u64)); - std::memcpy(bfttf_vec.data(), bfttf.data(), bfttf_vec.size()); - return std::make_shared(std::move(bfttf_vec), name); + u64 offset = 0; + Service::NS::EncryptSharedFont(vec, bfttf, offset); + return std::make_shared(std::move(bfttf), name); } } // Anonymous namespace -- cgit v1.2.3