Fix [#23578] Blender crashes when Audio Scrubbing is on
authorNathan Letwory <nathan@letworyinteractive.com>
Thu, 2 Sep 2010 21:56:08 +0000 (21:56 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Thu, 2 Sep 2010 21:56:08 +0000 (21:56 +0000)
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.

intern/audaspace/OpenAL/AUD_OpenALDevice.cpp

index aa7cfcfd880d36f481680c80acd993d269f29556..a87a4ad5eef11b05c2f2deb3f615936f827aa408 100644 (file)
@@ -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