Bug 1260377 - Fix CDMProxy::SetServerCertificate crash since null pointer. r=cpearce,a=ritu
authorJames Cheng <jacheng@mozilla.com>
Wed, 30 Mar 2016 11:26:44 +1300
changeset 325703 bdce1c532b56d098c956c6dcd9a8259407e12125
parent 325702 f5f4bbaf8f02c24f0c237991ef29e11f5835d414
child 325704 d59fb580e62f9db8f2b3428e3748cb82c0e545a1
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, ritu
bugs1260377
milestone47.0a2
Bug 1260377 - Fix CDMProxy::SetServerCertificate crash since null pointer. r=cpearce,a=ritu
dom/media/eme/CDMProxy.cpp
--- a/dom/media/eme/CDMProxy.cpp
+++ b/dom/media/eme/CDMProxy.cpp
@@ -329,17 +329,17 @@ CDMProxy::gmp_LoadSession(nsAutoPtr<Sess
 
 void
 CDMProxy::SetServerCertificate(PromiseId aPromiseId,
                                nsTArray<uint8_t>& aCert)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(mGMPThread);
 
-  nsAutoPtr<SetServerCertificateData> data;
+  nsAutoPtr<SetServerCertificateData> data(new SetServerCertificateData());
   data->mPromiseId = aPromiseId;
   data->mCert = Move(aCert);
   nsCOMPtr<nsIRunnable> task(
     NS_NewRunnableMethodWithArg<nsAutoPtr<SetServerCertificateData>>(this, &CDMProxy::gmp_SetServerCertificate, data));
   mGMPThread->Dispatch(task, NS_DISPATCH_NORMAL);
 }
 
 void