Fix [#23578] Blender crashes when Audio Scrubbing is on

Reported by Guy Smith.

MSVC-compiled code would fall over iterator decrease on empty list. Shortest snippet to redo: http://www.pasteall.org/15408/cpp
See also http://www.pasteall.org/15409/cpp for list.end() behaviour on MSVC. Thanks to Jörg Müller for assistance.
This commit is contained in:
Nathan Letwory
2010-09-02 21:56:08 +00:00
parent d8d3cc69ef
commit d372fc178c

View File

@@ -243,7 +243,10 @@ void AUD_OpenALDevice::updateStreams()
stop(sound); stop(sound);
// decrement again, so that we get the next sound in the // decrement again, so that we get the next sound in the
// next loop run // next loop run
--it; if(m_playingSounds->empty())
break;
else
--it;
} }
// continue playing // continue playing
else else