1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AudioTransportSource: Avoid nullptr dereference in hasStreamFinished()

This commit is contained in:
reuk 2024-11-25 15:33:04 +00:00
parent 2583b06481
commit dfe4858e55
No known key found for this signature in database

View file

@ -168,8 +168,9 @@ double AudioTransportSource::getLengthInSeconds() const
bool AudioTransportSource::hasStreamFinished() const noexcept
{
return positionableSource->getNextReadPosition() > positionableSource->getTotalLength() + 1
&& ! positionableSource->isLooping();
return positionableSource == nullptr
|| (positionableSource->getNextReadPosition() > positionableSource->getTotalLength() + 1
&& ! positionableSource->isLooping());
}
void AudioTransportSource::setNextReadPosition (int64 newPosition)