summaryrefslogtreecommitdiffstats
path: root/src/audio_core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-12-27 01:05:56 +0100
committerbunnei <bunneidev@gmail.com>2020-12-29 06:33:34 +0100
commitc7a06908ae1a1c0893876800944e494a0fa03918 (patch)
treef340d30504a510f60db6c8ca5b4063c2775e4685 /src/audio_core
parentcore: Do not reset device_memory on shutdown. (diff)
downloadyuzu-c7a06908ae1a1c0893876800944e494a0fa03918.tar
yuzu-c7a06908ae1a1c0893876800944e494a0fa03918.tar.gz
yuzu-c7a06908ae1a1c0893876800944e494a0fa03918.tar.bz2
yuzu-c7a06908ae1a1c0893876800944e494a0fa03918.tar.lz
yuzu-c7a06908ae1a1c0893876800944e494a0fa03918.tar.xz
yuzu-c7a06908ae1a1c0893876800944e494a0fa03918.tar.zst
yuzu-c7a06908ae1a1c0893876800944e494a0fa03918.zip
Diffstat (limited to '')
-rw-r--r--src/audio_core/stream.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp
index eca296589..afe68c9ed 100644
--- a/src/audio_core/stream.cpp
+++ b/src/audio_core/stream.cpp
@@ -130,7 +130,11 @@ bool Stream::ContainsBuffer([[maybe_unused]] Buffer::Tag tag) const {
std::vector<Buffer::Tag> Stream::GetTagsAndReleaseBuffers(std::size_t max_count) {
std::vector<Buffer::Tag> tags;
for (std::size_t count = 0; count < max_count && !released_buffers.empty(); ++count) {
- tags.push_back(released_buffers.front()->GetTag());
+ if (released_buffers.front()) {
+ tags.push_back(released_buffers.front()->GetTag());
+ } else {
+ ASSERT_MSG(false, "Invalid tag in released_buffers!");
+ }
released_buffers.pop();
}
return tags;
@@ -140,7 +144,11 @@ std::vector<Buffer::Tag> Stream::GetTagsAndReleaseBuffers() {
std::vector<Buffer::Tag> tags;
tags.reserve(released_buffers.size());
while (!released_buffers.empty()) {
- tags.push_back(released_buffers.front()->GetTag());
+ if (released_buffers.front()) {
+ tags.push_back(released_buffers.front()->GetTag());
+ } else {
+ ASSERT_MSG(false, "Invalid tag in released_buffers!");
+ }
released_buffers.pop();
}
return tags;