summaryrefslogtreecommitdiffstats
path: root/src/audio_core/renderer/behavior
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-09-10 20:01:11 +0200
committerGitHub <noreply@github.com>2022-09-10 20:01:11 +0200
commitcd4b9bffb2d42b1f8d4386b251a35344891df55a (patch)
tree53454fa29c30e9fa7f1f2c31f9586839d799f277 /src/audio_core/renderer/behavior
parentMerge pull request #8863 from german77/triggers (diff)
parentDon't stall with nvdec (diff)
downloadyuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.tar
yuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.tar.gz
yuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.tar.bz2
yuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.tar.lz
yuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.tar.xz
yuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.tar.zst
yuzu-cd4b9bffb2d42b1f8d4386b251a35344891df55a.zip
Diffstat (limited to 'src/audio_core/renderer/behavior')
-rw-r--r--src/audio_core/renderer/behavior/behavior_info.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/audio_core/renderer/behavior/behavior_info.cpp b/src/audio_core/renderer/behavior/behavior_info.cpp
index c5d4d66d8..92140aaea 100644
--- a/src/audio_core/renderer/behavior/behavior_info.cpp
+++ b/src/audio_core/renderer/behavior/behavior_info.cpp
@@ -43,13 +43,15 @@ void BehaviorInfo::AppendError(ErrorInfo& error) {
}
void BehaviorInfo::CopyErrorInfo(std::span<ErrorInfo> out_errors, u32& out_count) {
- auto error_count_{std::min(error_count, MaxErrors)};
- std::memset(out_errors.data(), 0, MaxErrors * sizeof(ErrorInfo));
-
- for (size_t i = 0; i < error_count_; i++) {
- out_errors[i] = errors[i];
+ out_count = std::min(error_count, MaxErrors);
+
+ for (size_t i = 0; i < MaxErrors; i++) {
+ if (i < out_count) {
+ out_errors[i] = errors[i];
+ } else {
+ out_errors[i] = {};
+ }
}
- out_count = error_count_;
}
void BehaviorInfo::UpdateFlags(const Flags flags_) {