CRASH: Exception thrown from -[AVContentKeySession processContentKeyRequestWithIdenti...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2018 21:23:29 +0000 (21:23 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2018 21:23:29 +0000 (21:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185690
<rdar://problem/38297768>

Reviewed by Eric Carlson.

Reject all calls to update() after close() has been called on the session.

* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update):

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

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

index 150475a..fbe2acb 100644 (file)
@@ -1,3 +1,16 @@
+2018-05-16  Jer Noble  <jer.noble@apple.com>
+
+        CRASH: Exception thrown from -[AVContentKeySession processContentKeyRequestWithIdentifier:initializationData:options:] after -expire called
+        https://bugs.webkit.org/show_bug.cgi?id=185690
+        <rdar://problem/38297768>
+
+        Reviewed by Eric Carlson.
+
+        Reject all calls to update() after close() has been called on the session.
+
+        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
+        (WebCore::CDMSessionAVContentKeySession::update):
+
 2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
 
         Add support for Intl NumberFormat formatToParts
index 7e70239..8ec647d 100644 (file)
@@ -237,6 +237,11 @@ bool CDMSessionAVContentKeySession::update(Uint8Array* key, RefPtr<Uint8Array>&
 {
     UNUSED_PARAM(nextMessage);
 
+    if (m_stopped) {
+        errorCode = MediaPlayer::InvalidPlayerState;
+        return false;
+    }
+
     bool shouldGenerateKeyRequest = !m_certificate || isEqual(key, "renew");
     if (!m_certificate) {
         LOG(Media, "CDMSessionAVContentKeySession::update(%p) - certificate data", this);