diff options
Diffstat (limited to 'src/hid_core')
-rw-r--r-- | src/hid_core/irsensor/image_transfer_processor.cpp | 5 | ||||
-rw-r--r-- | src/hid_core/irsensor/image_transfer_processor.h | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/hid_core/irsensor/image_transfer_processor.cpp b/src/hid_core/irsensor/image_transfer_processor.cpp index d6573f8dc..2b5a50ef6 100644 --- a/src/hid_core/irsensor/image_transfer_processor.cpp +++ b/src/hid_core/irsensor/image_transfer_processor.cpp @@ -145,9 +145,8 @@ void ImageTransferProcessor::SetTransferMemoryAddress(Common::ProcessAddress t_m } Core::IrSensor::ImageTransferProcessorState ImageTransferProcessor::GetState( - std::vector<u8>& data) const { - const auto size = GetDataSize(current_config.trimming_format); - data.resize(size); + std::span<u8> data) const { + const auto size = std::min(GetDataSize(current_config.trimming_format), data.size()); system.ApplicationMemory().ReadBlock(transfer_memory, data.data(), size); return processor_state; } diff --git a/src/hid_core/irsensor/image_transfer_processor.h b/src/hid_core/irsensor/image_transfer_processor.h index 4e0117084..df1c9d920 100644 --- a/src/hid_core/irsensor/image_transfer_processor.h +++ b/src/hid_core/irsensor/image_transfer_processor.h @@ -3,6 +3,8 @@ #pragma once +#include <span> + #include "common/typed_address.h" #include "hid_core/irsensor/irs_types.h" #include "hid_core/irsensor/processor_base.h" @@ -39,7 +41,7 @@ public: // Transfer memory where the image data will be stored void SetTransferMemoryAddress(Common::ProcessAddress t_mem); - Core::IrSensor::ImageTransferProcessorState GetState(std::vector<u8>& data) const; + Core::IrSensor::ImageTransferProcessorState GetState(std::span<u8> data) const; private: // This is nn::irsensor::ImageTransferProcessorConfig |