WebKit Bugzilla
Attachment 339809 Details for
Bug 185244
: [EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185244-20180508143136.patch (text/plain), 3.40 KB, created by
Yacine Bandou
on 2018-05-08 05:31:34 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yacine Bandou
Created:
2018-05-08 05:31:34 PDT
Size:
3.40 KB
patch
obsolete
>Subversion Revision: 231044 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 771ba46c52fbf635347ec11a383b205143c41583..dd0ed1c037a897dc2f6d1be88c17ea79062922d1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-05-03 Yacine Bandou <yacine.bandou_ext@softathome.com> >+ >+ [EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf >+ https://bugs.webkit.org/show_bug.cgi?id=185244 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" is expected to be called once, >+ so there is an ASSERT(!m_cdmInstance). >+ But when the MediaKeys are created before loading the media, the cdminstance is created and attached >+ to the MediaPlayerPrivate via "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" before loading >+ the media, then when the media is loading, the function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" >+ will be called several times via the function "mediaEngineWasUpdated" wich is called for each change >+ in the MediaElement state, thus the WebProcess crashes in the ASSERT(!m_cdmInstance). >+ >+ This commit avoid the crash by replacing the assert with a simple check. >+ >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached): >+ (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached): >+ > 2018-05-03 Yacine Bandou <yacine.bandou_ext@softathome.com> > > [MSE][GStreamer] Delete properly the stream from the WebKitMediaSource >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >index 1557475e95fb6832105ba8d7938ca2486a90a4fd..2e87676cbcd3379cc7b59feffd0222ab9ac4e81e 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp >@@ -1207,10 +1207,11 @@ unsigned MediaPlayerPrivateGStreamerBase::videoDecodedByteCount() const > #if ENABLE(ENCRYPTED_MEDIA) > void MediaPlayerPrivateGStreamerBase::cdmInstanceAttached(CDMInstance& instance) > { >- ASSERT(!m_cdmInstance); >- m_cdmInstance = &instance; >- GST_DEBUG_OBJECT(pipeline(), "CDM instance %p set", m_cdmInstance.get()); >- m_protectionCondition.notifyAll(); >+ if (m_cdmInstance != &instance) { >+ m_cdmInstance = &instance; >+ GST_DEBUG_OBJECT(pipeline(), "CDM instance %p set", m_cdmInstance.get()); >+ m_protectionCondition.notifyAll(); >+ } > } > > void MediaPlayerPrivateGStreamerBase::cdmInstanceDetached(CDMInstance& instance) >@@ -1218,10 +1219,11 @@ void MediaPlayerPrivateGStreamerBase::cdmInstanceDetached(CDMInstance& instance) > #ifdef NDEBUG > UNUSED_PARAM(instance); > #endif >- ASSERT(m_cdmInstance.get() == &instance); >- GST_DEBUG_OBJECT(pipeline(), "detaching CDM instance %p", m_cdmInstance.get()); >- m_cdmInstance = nullptr; >- m_protectionCondition.notifyAll(); >+ if (m_cdmInstance == &instance) { >+ GST_DEBUG_OBJECT(pipeline(), "detaching CDM instance %p", m_cdmInstance.get()); >+ m_cdmInstance = nullptr; >+ m_protectionCondition.notifyAll(); >+ } > } > > void MediaPlayerPrivateGStreamerBase::attemptToDecryptWithInstance(CDMInstance& instance)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185244
:
339483
|
339501
|
339714
| 339809