diff options
author | Chris Robinson <[email protected]> | 2023-03-05 23:27:55 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-05 23:27:55 -0800 |
commit | 3184ab5d67df6318c8fa2ffeb424483b1b4e5c70 (patch) | |
tree | 440007389877bec92c4cf9f35bee3382e565c9e1 /al | |
parent | 1e5af1eb2f8334045e71a831f98424f1eb19854a (diff) |
Don't get the front element of an empty queue
Diffstat (limited to 'al')
-rw-r--r-- | al/source.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/al/source.cpp b/al/source.cpp index d39c1edc..34d332c6 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -2179,7 +2179,10 @@ try { * buffer's ID when playing. */ if(Source->SourceType == AL_STATIC || Source->state == AL_INITIAL) - BufferList = &Source->mQueue.front(); + { + if(!Source->mQueue.empty()) + BufferList = &Source->mQueue.front(); + } else if(Voice *voice{GetSourceVoice(Source, Context)}) { VoiceBufferItem *Current{voice->mCurrentBuffer.load(std::memory_order_relaxed)}; |