Title: [260815] trunk/Source/WebCore
Revision
260815
Author
[email protected]
Date
2020-04-28 03:58:24 -0700 (Tue, 28 Apr 2020)

Log Message

[EME][CDMProxy] Default initialize m_numDecryptorsWaitingForKey member
https://bugs.webkit.org/show_bug.cgi?id=210970

Reviewed by Xabier Rodriguez-Calvar.

This was causing non-deterministic reads of the
m_numDecryptorsWaitingForKey member. Sometimes a waiting for key
event would fail to fire and cause test failures. I thought
std::atomic<int> would default initialize to zero, but after
spec-diving I realise now I was wrong about that.

Test: encrypted-media/clearkey-mp4-waiting-for-a-key.https.html

* platform/encryptedmedia/CDMProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (260814 => 260815)


--- trunk/Source/WebCore/ChangeLog	2020-04-28 10:08:53 UTC (rev 260814)
+++ trunk/Source/WebCore/ChangeLog	2020-04-28 10:58:24 UTC (rev 260815)
@@ -1,3 +1,20 @@
+2020-04-28  Charlie Turner  <[email protected]>
+
+        [EME][CDMProxy] Default initialize m_numDecryptorsWaitingForKey member
+        https://bugs.webkit.org/show_bug.cgi?id=210970
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        This was causing non-deterministic reads of the
+        m_numDecryptorsWaitingForKey member. Sometimes a waiting for key
+        event would fail to fire and cause test failures. I thought
+        std::atomic<int> would default initialize to zero, but after
+        spec-diving I realise now I was wrong about that.
+
+        Test: encrypted-media/clearkey-mp4-waiting-for-a-key.https.html
+
+        * platform/encryptedmedia/CDMProxy.h:
+
 2020-04-28  Youenn Fablet  <[email protected]>
 
         RTCPeerConnection should not remove its created remote MediaStream objects until getting close

Modified: trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h (260814 => 260815)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h	2020-04-28 10:08:53 UTC (rev 260814)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMProxy.h	2020-04-28 10:58:24 UTC (rev 260815)
@@ -194,7 +194,7 @@
     // As a CDMProxy, we ***should*** be turned off before this pointer ever goes bad.
     MediaPlayer* m_player { nullptr }; // FIXME: MainThread<T>?
 
-    std::atomic<int> m_numDecryptorsWaitingForKey;
+    std::atomic<int> m_numDecryptorsWaitingForKey { 0 };
     Vector<RefPtr<CDMInstanceSession>> m_sessions;
 
     KeyStore m_keyStore;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to