diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2018-10-12 08:10:41 +0200 |
---|---|---|
committer | David Marcec <dmarcecguzman@gmail.com> | 2018-10-12 08:10:41 +0200 |
commit | 4d2de6564f6361f8732f734afdc8cfa74d7530ff (patch) | |
tree | 062b866ebd3ea49d007972e8bd402e32f0b40a4a /src | |
parent | Passing an invalid nmap handle to Remap should throw an error (diff) | |
download | yuzu-4d2de6564f6361f8732f734afdc8cfa74d7530ff.tar yuzu-4d2de6564f6361f8732f734afdc8cfa74d7530ff.tar.gz yuzu-4d2de6564f6361f8732f734afdc8cfa74d7530ff.tar.bz2 yuzu-4d2de6564f6361f8732f734afdc8cfa74d7530ff.tar.lz yuzu-4d2de6564f6361f8732f734afdc8cfa74d7530ff.tar.xz yuzu-4d2de6564f6361f8732f734afdc8cfa74d7530ff.tar.zst yuzu-4d2de6564f6361f8732f734afdc8cfa74d7530ff.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp index 7424fa72f..884837b17 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp @@ -84,7 +84,6 @@ u32 nvhost_as_gpu::Remap(const std::vector<u8>& input, std::vector<u8>& output) std::memcpy(entries.data(), input.data(), input.size()); auto& gpu = Core::System::GetInstance().GPU(); - bool failed_remap{}; for (const auto& entry : entries) { LOG_WARNING(Service_NVDRV, "remap entry, offset=0x{:X} handle=0x{:X} pages=0x{:X}", entry.offset, entry.nvmap_handle, entry.pages); @@ -92,8 +91,8 @@ u32 nvhost_as_gpu::Remap(const std::vector<u8>& input, std::vector<u8>& output) auto object = nvmap_dev->GetObject(entry.nvmap_handle); if (!object) { LOG_CRITICAL(Service_NVDRV, "nvmap {} is an invalid handle!", entry.nvmap_handle); - failed_remap = true; - continue; + std::memcpy(output.data(), entries.data(), output.size()); + return static_cast<u32>(NvErrCodes::InvalidNmapHandle); } ASSERT(object->status == nvmap::Object::Status::Allocated); @@ -105,9 +104,6 @@ u32 nvhost_as_gpu::Remap(const std::vector<u8>& input, std::vector<u8>& output) ASSERT(returned == offset); } std::memcpy(output.data(), entries.data(), output.size()); - if (failed_remap) { - return static_cast<u32>(NvErrCodes::InvalidNmapHandle); - } return 0; } |