Stop Audio.bgm_pos from segfaulting if the source never actually loaded

This commit is contained in:
Struma 2021-06-13 14:48:22 -04:00 committed by Roza
parent 3626ac072f
commit 2177823ed5

View file

@ -186,7 +186,7 @@ ALStream::State ALStream::queryState()
float ALStream::queryOffset()
{
if (state == Closed)
if (state == Closed || !source)
return 0;
float procOffset = static_cast<float>(procFrames) / source->sampleRate();