[WinCairo][MediaFoundation] Crash when media player is destroyed.
authorpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Mar 2016 17:54:19 +0000 (17:54 +0000)
committerpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Mar 2016 17:54:19 +0000 (17:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155716

Reviewed by Alex Christensen.

Increase the reference count on the video presenter object in the ActivateObject method
to avoid referencing a deleted object when the media player is destroyed.

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

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

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

index 9288f42..6da1b46 100644 (file)
@@ -1,3 +1,16 @@
+2016-03-21  Per Arne Vollan  <peavo@outlook.com>
+
+        [WinCairo][MediaFoundation] Crash when media player is destroyed.
+        https://bugs.webkit.org/show_bug.cgi?id=155716
+
+        Reviewed by Alex Christensen.
+
+        Increase the reference count on the video presenter object in the ActivateObject method
+        to avoid referencing a deleted object when the media player is destroyed.
+
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
+        (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ActivateObject):
+
 2016-03-21  Eric Carlson  <eric.carlson@apple.com>
 
         Add a WebRTC specific compile flag
index 684f55b..cf1f589 100644 (file)
@@ -1167,6 +1167,7 @@ HRESULT MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ActivateObject(
 
     if (riid == IID_IMFVideoPresenter) {
         *ppv = static_cast<IMFVideoPresenter*>(this);
+        AddRef();
         return S_OK;
     }
     return E_FAIL;