Null-dereference in SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExtern...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2018 15:28:14 +0000 (15:28 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2018 15:28:14 +0000 (15:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190490
<rdar://problem/42213807>

Reviewed by Eric Carlson.

Crash analytics show a null dereference occurring, likely because m_mediaSource is null.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm

index 69dcab0..5d1d8f6 100644 (file)
@@ -1,3 +1,16 @@
+2018-10-12  Jer Noble  <jer.noble@apple.com>
+
+        Null-dereference in SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged
+        https://bugs.webkit.org/show_bug.cgi?id=190490
+        <rdar://problem/42213807>
+
+        Reviewed by Eric Carlson.
+
+        Crash analytics show a null dereference occurring, likely because m_mediaSource is null.
+
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
+
 2018-10-11  Don Olmstead  <don.olmstead@sony.com>
 
         Add Houdini specs to features.json
index 97137ac..d378984 100644 (file)
@@ -979,8 +979,9 @@ void SourceBufferPrivateAVFObjC::layerDidReceiveError(AVSampleBufferDisplayLayer
 void SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged(bool obscured)
 {
 #if ENABLE(ENCRYPTED_MEDIA) && HAVE(AVCONTENTKEYSESSION)
-    if (m_mediaSource->player()->cdmInstance()) {
-        m_mediaSource->player()->outputObscuredDueToInsufficientExternalProtectionChanged(obscured);
+    auto player = m_mediaSource ? m_mediaSource->player() : nullptr;
+    if (player && player->cdmInstance()) {
+        player->outputObscuredDueToInsufficientExternalProtectionChanged(obscured);
         return;
     }
 #else