From 4937524b733658cd54b8cdeea49ac3900a22802a Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Thu, 8 Apr 2021 23:16:56 +0200 Subject: [PATCH] early-access version 1568 --- README.md | 2 +- .../nvdrv/devices/nvhost_nvdec_common.cpp | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7e1ada23d..d9285b91c 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1567. +This is the source code for early-access 1568. ## Legal Notice diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp index d1b5136da..6654aa66d 100755 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp @@ -23,17 +23,22 @@ namespace { template std::size_t SpliceVectors(const std::vector& input, std::vector& dst, std::size_t count, std::size_t offset) { - std::memcpy(dst.data(), input.data() + offset, count * sizeof(T)); - offset += count * sizeof(T); - return offset; + if (!dst.empty()) { + std::memcpy(dst.data(), input.data() + offset, count * sizeof(T)); + } + return 0; } // Write vectors will write data to the output buffer template std::size_t WriteVectors(std::vector& dst, const std::vector& src, std::size_t offset) { - std::memcpy(dst.data() + offset, src.data(), src.size() * sizeof(T)); - offset += src.size() * sizeof(T); - return offset; + if (src.empty()) { + return 0; + } else { + std::memcpy(dst.data() + offset, src.data(), src.size() * sizeof(T)); + offset += src.size() * sizeof(T); + return offset; + } } } // Anonymous namespace