diff options
author | bunnei <bunneidev@gmail.com> | 2020-12-27 01:05:56 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-12-29 06:33:34 +0100 |
commit | c7a06908ae1a1c0893876800944e494a0fa03918 (patch) | |
tree | f340d30504a510f60db6c8ca5b4063c2775e4685 /src | |
parent | core: Do not reset device_memory on shutdown. (diff) | |
download | yuzu-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 'src')
-rw-r--r-- | src/audio_core/stream.cpp | 12 |
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; |