From d372fc178c6488e71d14a7fc56e9fd9ee27812e3 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Thu, 2 Sep 2010 21:56:08 +0000 Subject: Fix [#23578] Blender crashes when Audio Scrubbing is on Reported by Guy Smith. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- intern/audaspace/OpenAL/AUD_OpenALDevice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'intern/audaspace/OpenAL') diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp index aa7cfcfd880..a87a4ad5eef 100644 --- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp +++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp @@ -243,7 +243,10 @@ void AUD_OpenALDevice::updateStreams() stop(sound); // decrement again, so that we get the next sound in the // next loop run - --it; + if(m_playingSounds->empty()) + break; + else + --it; } // continue playing else -- cgit v1.2.3