From 12bbd990473677c5b3b1c37c317819e73b606e4a Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 11 Dec 2012 17:13:26 +0100 Subject: WMF: Fixed crash when cancelling media loading. Since media loading is asynchronous, cancelling could cause a crash when done after the media is loaded but the callback hasn't been called yet. Change-Id: I9c9b7bfaa495b9e75765111c15afb07e8b699488 Reviewed-by: Andy Nichols --- src/plugins/wmf/sourceresolver.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/wmf') diff --git a/src/plugins/wmf/sourceresolver.cpp b/src/plugins/wmf/sourceresolver.cpp index c5d99959a..9abe65845 100644 --- a/src/plugins/wmf/sourceresolver.cpp +++ b/src/plugins/wmf/sourceresolver.cpp @@ -108,6 +108,10 @@ STDMETHODIMP_(ULONG) SourceResolver::Release(void) HRESULT STDMETHODCALLTYPE SourceResolver::Invoke(IMFAsyncResult *pAsyncResult) { QMutexLocker locker(&m_mutex); + + if (!m_sourceResolver) + return S_OK; + MF_OBJECT_TYPE ObjectType = MF_OBJECT_INVALID; IUnknown* pSource = NULL; State *state = static_cast(pAsyncResult->GetStateNoAddRef()); -- cgit v1.2.3