diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp index 073bbff905..54c52a5cab 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec.cpp @@ -81,7 +81,7 @@ u32 nvhost_nvdec::ChannelSubmit(const std::vector& input, std::vector& o sizeof(IoctlSyncPtIncr) * params.num_syncpt_incrs); startPt += sizeof(IoctlSyncPtIncr) * params.num_syncpt_incrs; // apply increment to sync points and create new one if not existed - for (auto syncIncr : syncPtIncrs) { + for (const auto& syncIncr : syncPtIncrs) { auto itr = syncPtValues.find(syncIncr.syncpt_id); if (itr == syncPtValues.end()) { syncPtValues[syncIncr.syncpt_id] = syncIncr.syncpt_incrs; @@ -95,7 +95,7 @@ u32 nvhost_nvdec::ChannelSubmit(const std::vector& input, std::vector& o "(STUBBED) called, num_cmdbufs: {}, num_relocs: {}, num_syncpt_incrs: {}, num_fences: {}", params.num_cmdbufs, params.num_relocs, params.num_syncpt_incrs, params.num_fences); - std::memcpy(output.data(), ¶ms, 16); + std::memcpy(output.data(), ¶ms, sizeof(params)); return 0; } @@ -128,7 +128,7 @@ u32 nvhost_nvdec::ChannelGetWaitBase(const std::vector& input, std::vector& input, std::vector& output) { IoctlMapCmdBuffer params{}; - std::memcpy(¶ms, input.data(), 12); + std::memcpy(¶ms, input.data(), sizeof(params)); std::vector handles(params.num_handles); std::memcpy(handles.data(), input.data() + 12, @@ -140,7 +140,7 @@ u32 nvhost_nvdec::ChannelMapCmdBuffer(const std::vector& input, std::vector< // TODO(namkazt): Uses nvmap_pin internally to pin a given number of nvmap handles to an // appropriate device physical address. - std::memcpy(output.data(), ¶ms, 12); + std::memcpy(output.data(), ¶ms, sizeof(params)); std::memcpy(output.data() + 12, handles.data(), sizeof(IoctlHandleMapBuffer) * params.num_handles); return 0;