AE: possible segfault after suspend / resume (m_sink might be gone)
authorfritsch <peter.fruehberger@gmail.com>
Tue, 26 Mar 2013 22:17:51 +0000 (23:17 +0100)
committerfritsch <peter.fruehberger@gmail.com>
Tue, 26 Mar 2013 22:19:39 +0000 (23:19 +0100)
xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp

index 6ec78c5..7aaecf5 100644 (file)
@@ -1536,7 +1536,8 @@ inline void CSoftAE::ProcessSuspend()
      */
     if (!m_isSuspended && (!m_playingStreams.empty() || !m_playing_sounds.empty()))
     {
-      m_reOpen = !m_sink->SoftResume() || m_reOpen; // sink returns false if it requires reinit (worthless with current implementation)
+      // the sink might still be not initialized after Resume of real suspend
+      m_reOpen = m_sink && (!m_sink->SoftResume() || m_reOpen); // sink returns false if it requires reinit (worthless with current implementation)
       m_sinkIsSuspended = false; //sink processing data
       m_softSuspend   = false; //break suspend loop (under some conditions)
       CLog::Log(LOGDEBUG, "Resumed the Sink");