summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-07-31 03:09:13 +0200
committerSubv <subv2112@gmail.com>2018-07-31 03:09:13 +0200
commite119e17d1824cbc41153d8f55d81b76b3da438f6 (patch)
treec5d6a836d03be566f4efa3679482589d7f5bc644 /src/core/hle
parentnvhost_ctrl_gpu: Only read the input parameters if they are actually there. (diff)
downloadyuzu-e119e17d1824cbc41153d8f55d81b76b3da438f6.tar
yuzu-e119e17d1824cbc41153d8f55d81b76b3da438f6.tar.gz
yuzu-e119e17d1824cbc41153d8f55d81b76b3da438f6.tar.bz2
yuzu-e119e17d1824cbc41153d8f55d81b76b3da438f6.tar.lz
yuzu-e119e17d1824cbc41153d8f55d81b76b3da438f6.tar.xz
yuzu-e119e17d1824cbc41153d8f55d81b76b3da438f6.tar.zst
yuzu-e119e17d1824cbc41153d8f55d81b76b3da438f6.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
index 126782573..5a1123ad2 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
@@ -132,9 +132,12 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp
LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}",
params.address, params.num_entries, params.flags);
- auto entries = std::vector<IoctlGpfifoEntry>();
- entries.resize(params.num_entries);
- std::memcpy(&entries[0], &input.data()[sizeof(IoctlSubmitGpfifo)],
+ ASSERT_MSG(input.size() ==
+ sizeof(IoctlSubmitGpfifo) + params.num_entries * sizeof(IoctlGpfifoEntry),
+ "Incorrect input size");
+
+ std::vector<IoctlGpfifoEntry> entries(params.num_entries);
+ std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)],
params.num_entries * sizeof(IoctlGpfifoEntry));
for (auto entry : entries) {
Tegra::GPUVAddr va_addr = entry.Address();