From b3d88c66be2ba6a6975cd3dd152a40fe429ecb6c Mon Sep 17 00:00:00 2001
From: David Schulz <david.schulz@digia.com>
Date: Thu, 25 Sep 2014 07:15:25 +0200
Subject: [PATCH] WMF: Fix null ptr derefernce in MFPlayerSession.

Checking the sender of the mediaSourceReady signal to prevent accessing
the incorrect source resolver.

When the source resolver has finished the asynchronous operation and
the source resolver gets recreated in the player at the same time in a
different thread the signal mediaSourceReady still gets emitted from the
old source resolver.

The player assumes that the signal was emitted from the current source
resolver and accesses the unresolved media source in the
handleMediaSourceReady slot.

Task-number: QTBUG-39980
Change-Id: Ic52f6918995aac250048d91f89c520cfea111bd0
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
---
 src/plugins/wmf/player/mfplayersession.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp
index 0de0bdfd8..2d4f46b1d 100644
--- a/src/plugins/wmf/player/mfplayersession.cpp
+++ b/src/plugins/wmf/player/mfplayersession.cpp
@@ -250,7 +250,7 @@ void MFPlayerSession::handleSourceError(long hr)
 
 void MFPlayerSession::handleMediaSourceReady()
 {
-    if (QMediaPlayer::LoadingMedia != m_status || !m_sourceResolver)
+    if (QMediaPlayer::LoadingMedia != m_status || !m_sourceResolver || m_sourceResolver != sender())
         return;
 #ifdef DEBUG_MEDIAFOUNDATION
     qDebug() << "handleMediaSourceReady";
-- 
GitLab