diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp index 933d42f3fe..2edd803f3c 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp @@ -248,7 +248,13 @@ NvResult nvhost_ctrl_gpu::ZBCSetTable(const std::vector& input, std::vector< IoctlZbcSetTable params{}; std::memcpy(¶ms, input.data(), input.size()); // TODO(ogniK): What does this even actually do? - std::memcpy(output.data(), ¶ms, output.size()); + + // Prevent null pointer being passed as arg 1 + if (output.empty()) { + LOG_WARNING(Service_NVDRV, "Avoiding passing null pointer to memcpy"); + } else { + std::memcpy(output.data(), ¶ms, output.size()); + } return NvResult::Success; }