(Attempt to) fix crashes when scroll events hit the audio display and no audio is loaded.

Originally committed to SVN as r1522.
This commit is contained in:
Niels Martin Hansen 2007-08-20 18:09:18 +00:00
parent 388429b899
commit ed9dc1c28e

View file

@ -731,6 +731,7 @@ void AudioDisplay::SetPosition(int pos) {
// Update position
void AudioDisplay::UpdatePosition (int pos,bool IsSample) {
// Safeguards
if (!provider) return;
if (IsSample) pos /= samples;
int len = provider->GetNumSamples() / samples;
if (pos < 0) pos = 0;