mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-18 08:59:59 +00:00
Avoid depop out of bounds
This commit is contained in:
parent
ea861cc1c4
commit
6c47b43a60
2 changed files with 2 additions and 2 deletions
|
@ -339,7 +339,7 @@ void CommandBuffer::GenerateDepopPrepareCommand(const s32 node_id, const VoiceSt
|
||||||
cmd.previous_samples = memory_pool->Translate(CpuAddr(voice_state.previous_samples.data()),
|
cmd.previous_samples = memory_pool->Translate(CpuAddr(voice_state.previous_samples.data()),
|
||||||
MaxMixBuffers * sizeof(s32));
|
MaxMixBuffers * sizeof(s32));
|
||||||
cmd.buffer_count = buffer_count;
|
cmd.buffer_count = buffer_count;
|
||||||
cmd.depop_buffer = memory_pool->Translate(CpuAddr(buffer.data()), buffer_count * sizeof(s32));
|
cmd.depop_buffer = memory_pool->Translate(CpuAddr(buffer.data()), buffer.size_bytes());
|
||||||
|
|
||||||
GenerateEnd<DepopPrepareCommand>(cmd);
|
GenerateEnd<DepopPrepareCommand>(cmd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ void DepopPrepareCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor
|
||||||
|
|
||||||
void DepopPrepareCommand::Process(const ADSP::CommandListProcessor& processor) {
|
void DepopPrepareCommand::Process(const ADSP::CommandListProcessor& processor) {
|
||||||
auto samples{reinterpret_cast<s32*>(previous_samples)};
|
auto samples{reinterpret_cast<s32*>(previous_samples)};
|
||||||
auto buffer{std::span(reinterpret_cast<s32*>(depop_buffer), buffer_count)};
|
auto buffer{reinterpret_cast<s32*>(depop_buffer)};
|
||||||
|
|
||||||
for (u32 i = 0; i < buffer_count; i++) {
|
for (u32 i = 0; i < buffer_count; i++) {
|
||||||
if (samples[i]) {
|
if (samples[i]) {
|
||||||
|
|
Loading…
Reference in a new issue