Bug 1270689 - Clear WidevineDecryptor::mCallback in WidevineDecryptor::DecryptingComplete(). r=gerald
authorChris Pearce <cpearce@mozilla.com>
Mon, 16 May 2016 14:34:20 +1200
changeset 336498 30f9e7dfcd3d3de1d949f523d353d9956f2b976a
parent 336497 90d3d6d61504290f0d4ba35fddbe5106d8173ea0
child 336499 2937d6bde0084c42a4b549d034811bbd92e0597f
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1270689
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1270689 - Clear WidevineDecryptor::mCallback in WidevineDecryptor::DecryptingComplete(). r=gerald The OnSessionClosed() callback is happening on a timer, after WidevineDecryptor::DecryptingComplete() has been called. So mCallback could actually be non-null because DecryptingComplete() has been called, but the object pointed to by mCallback has been deallocated, and mCallback is a dangling pointer. MozReview-Commit-ID: 4xdHYRn7EAS
dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp
--- a/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp
+++ b/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp
@@ -182,16 +182,17 @@ WidevineDecryptor::Decrypt(GMPBuffer* aB
   mCallback->Decrypted(aBuffer, ToGMPErr(rv));
 }
 
 void
 WidevineDecryptor::DecryptingComplete()
 {
   Log("WidevineDecryptor::DecryptingComplete() this=%p", this);
   mCDM = nullptr;
+  mCallback = nullptr;
   Release();
 }
 
 class WidevineBuffer : public cdm::Buffer {
 public:
   WidevineBuffer(size_t aSize) {
     Log("WidevineBuffer(size=" PRIuSIZE ") created", aSize);
     mBuffer.SetLength(aSize);