summaryrefslogtreecommitdiffstats
path: root/src/audio_core/hle/pipe.cpp
diff options
context:
space:
mode:
authorAlexander Laties <alex.laties@gmail.com>2016-04-25 22:10:03 +0200
committerAlexander Laties <alex.laties@gmail.com>2016-05-07 17:41:55 +0200
commit0a31e373f1728316b3dfed391ddcb99a474e4102 (patch)
tree1b1bcf1af2398481e7208610f6a2e49264fe11db /src/audio_core/hle/pipe.cpp
parentMerge pull request #1736 from MerryMage/sdl2-sink (diff)
downloadyuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.tar
yuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.tar.gz
yuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.tar.bz2
yuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.tar.lz
yuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.tar.xz
yuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.tar.zst
yuzu-0a31e373f1728316b3dfed391ddcb99a474e4102.zip
Diffstat (limited to '')
-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) {
return {};
}
+ if (length > UINT16_MAX) { // Can only read at most UINT16_MAX from the pipe
+ LOG_ERROR(Audio_DSP, "length of %u greater than max of %u", length, UINT16_MAX);
+ return {};
+ }
+
std::vector<u8>& data = pipe_data[pipe_index];
if (length > data.size()) {
LOG_WARNING(Audio_DSP, "pipe_number = %zu is out of data, application requested read of %u but %zu remain",
pipe_index, length, data.size());
- length = data.size();
+ length = static_cast<u32>(data.size());
}
if (length == 0)
@@ -94,7 +99,7 @@ static void AudioPipeWriteStructAddresses() {
};
// Begin with a u16 denoting the number of structs.
- WriteU16(DspPipe::Audio, struct_addresses.size());
+ WriteU16(DspPipe::Audio, static_cast<u16>(struct_addresses.size()));
// Then write the struct addresses.
for (u16 addr : struct_addresses) {
WriteU16(DspPipe::Audio, addr);