[webkit-changes] [WebKit/WebKit] 9ba628: [EME] CDMInstanceProxy: Use weak ptr for keeping p...

Xabier Rodríguez noreply at github.com
Thu Nov 17 23:41:05 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9ba628e9a29dbe1c7519f925f8e3f1ce94e73076
      https://github.com/WebKit/WebKit/commit/9ba628e9a29dbe1c7519f925f8e3f1ce94e73076
  Author: Xabier Rodriguez-Calvar <calvaris at igalia.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/platform/encryptedmedia/CDMProxy.h
    M Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

  Log Message:
  -----------
  [EME] CDMInstanceProxy: Use weak ptr for keeping player
https://bugs.webkit.org/show_bug.cgi?id=247977

Reviewed by Philippe Normand.

Use WeakPtr for keeping media player ptr as it can be used after player is destroyed. The media player can be removed by
HTMLMediaElement::load() request while still waiting for decryption key. CDM is not aware of such case and tries to use
m_player ptr anyway that resuts with crash.

Also reset m_playbackBlockedWaitingForKey when calling load() as the player will be re-created.

Patch by Andrzej Surdej <Andrzej_Surdej at comcast.com> coming from
https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/900.

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad):
* Source/WebCore/platform/encryptedmedia/CDMProxy.h:
(WebCore::CDMInstanceProxy::setPlayer):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::cdmInstanceAttached):

Canonical link: https://commits.webkit.org/256823@main




More information about the webkit-changes mailing list