summaryrefslogtreecommitdiff
path: root/src/audio_core/hle/pipe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio_core/hle/pipe.cpp')
-rw-r--r--src/audio_core/hle/pipe.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/audio_core/hle/pipe.cpp b/src/audio_core/hle/pipe.cpp
index 03280780f..44dff1345 100644
--- a/src/audio_core/hle/pipe.cpp
+++ b/src/audio_core/hle/pipe.cpp
@@ -36,12 +36,17 @@ std::vector<u8> PipeRead(DspPipe pipe_number, u32 length) {
36 return {}; 36 return {};
37 } 37 }
38 38
39 if (length > UINT16_MAX) { // Can only read at most UINT16_MAX from the pipe
40 LOG_ERROR(Audio_DSP, "length of %u greater than max of %u", length, UINT16_MAX);
41 return {};
42 }
43
39 std::vector<u8>& data = pipe_data[pipe_index]; 44 std::vector<u8>& data = pipe_data[pipe_index];
40 45
41 if (length > data.size()) { 46 if (length > data.size()) {
42 LOG_WARNING(Audio_DSP, "pipe_number = %zu is out of data, application requested read of %u but %zu remain", 47 LOG_WARNING(Audio_DSP, "pipe_number = %zu is out of data, application requested read of %u but %zu remain",
43 pipe_index, length, data.size()); 48 pipe_index, length, data.size());
44 length = data.size(); 49 length = static_cast<u32>(data.size());
45 } 50 }
46 51
47 if (length == 0) 52 if (length == 0)
@@ -94,7 +99,7 @@ static void AudioPipeWriteStructAddresses() {
94 }; 99 };
95 100
96 // Begin with a u16 denoting the number of structs. 101 // Begin with a u16 denoting the number of structs.
97 WriteU16(DspPipe::Audio, struct_addresses.size()); 102 WriteU16(DspPipe::Audio, static_cast<u16>(struct_addresses.size()));
98 // Then write the struct addresses. 103 // Then write the struct addresses.
99 for (u16 addr : struct_addresses) { 104 for (u16 addr : struct_addresses) {
100 WriteU16(DspPipe::Audio, addr); 105 WriteU16(DspPipe::Audio, addr);