Fix non-thread safe use of makeWeakPtr() under MediaPlayerPrivateMediaFoundation...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jul 2019 04:36:59 +0000 (04:36 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jul 2019 04:36:59 +0000 (04:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199727

Reviewed by Eric Carlson.

Stop calling makeWeakPtr() on a main thread object from a background thread.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247383 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp

index 29f214e..d404d74 100644 (file)
@@ -1,3 +1,15 @@
+2019-07-11  Chris Dumez  <cdumez@apple.com>
+
+        Fix non-thread safe use of makeWeakPtr() under MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify()
+        https://bugs.webkit.org/show_bug.cgi?id=199727
+
+        Reviewed by Eric Carlson.
+
+        Stop calling makeWeakPtr() on a main thread object from a background thread.
+
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
+        (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
+
 2019-07-11  Youenn Fablet  <youenn@apple.com>
 
         Register a MediaStreamTrack as media producer only if it is a capture track
index aac0570..cbd01e0 100644 (file)
@@ -1589,7 +1589,7 @@ HRESULT MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNot
     
     // Invalidate the video area
     if (m_mediaPlayer) {
-        callOnMainThread([weakPtr = makeWeakPtr(*m_mediaPlayer)] {
+        callOnMainThread([weakPtr = m_mediaPlayer->m_weakThis] {
             if (weakPtr)
                 weakPtr->invalidateFrameView();
         });