Title: [261100] trunk/Source/WebCore
Revision
261100
Author
[email protected]
Date
2020-05-04 12:44:50 -0700 (Mon, 04 May 2020)

Log Message

Add additional null checks to MediaPlayerPrivateMediaSourceAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=211134
<rdar://problem/62056577>

Reviewed by Daniel Bates.

Add additional null checks for a set m_mediaSourcePrivate to MediaPlayerPrivateMediaSourceAVFObjC.  Most uses in this
class are already guarded, but a few were not, which could lead to a null pointer crash if encountered.

No new tests; no functional changes.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (261099 => 261100)


--- trunk/Source/WebCore/ChangeLog	2020-05-04 19:28:21 UTC (rev 261099)
+++ trunk/Source/WebCore/ChangeLog	2020-05-04 19:44:50 UTC (rev 261100)
@@ -1,3 +1,20 @@
+2020-05-04  Doug Kelly  <[email protected]>
+
+        Add additional null checks to MediaPlayerPrivateMediaSourceAVFObjC
+        https://bugs.webkit.org/show_bug.cgi?id=211134
+        <rdar://problem/62056577>
+
+        Reviewed by Daniel Bates.
+
+        Add additional null checks for a set m_mediaSourcePrivate to MediaPlayerPrivateMediaSourceAVFObjC.  Most uses in this
+        class are already guarded, but a few were not, which could lead to a null pointer crash if encountered.
+
+        No new tests; no functional changes.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
+
 2020-05-04  Darin Adler  <[email protected]>
 
         Remove now-unneeded HAVE(MEDIA_PLAYER)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (261099 => 261100)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2020-05-04 19:28:21 UTC (rev 261099)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2020-05-04 19:44:50 UTC (rev 261100)
@@ -332,6 +332,9 @@
 
 void MediaPlayerPrivateMediaSourceAVFObjC::playInternal()
 {
+    if (!m_mediaSourcePrivate)
+        return;
+
     if (currentMediaTime() >= m_mediaSourcePrivate->duration()) {
         ALWAYS_LOG(LOGIDENTIFIER, "bailing, current time: ", currentMediaTime(), " greater than duration ", m_mediaSourcePrivate->duration());
         return;
@@ -1055,6 +1058,9 @@
         cdmStreamSession->setStreamSession(streamSession());
 #endif
 
+    if (!m_mediaSourcePrivate)
+        return;
+
     for (auto& sourceBuffer : m_mediaSourcePrivate->sourceBuffers())
         sourceBuffer->setCDMSession(m_session.get());
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to