Bug 1260377 - Fix CDMProxy::SetServerCertificate crash since null pointer. r=cpearce
authorJames Cheng <jacheng@mozilla.com>
Wed, 30 Mar 2016 11:26:44 +1300
changeset 291001 690f9c2a909b45dbbc98c3d2694a0d626edb0f5a
parent 291000 57a5ea9600319dba3b60f7df33945e9e1fc347de
child 291002 8710643c72dbc2fc9ce7189ece5cf36a1a2719b3
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1260377
milestone48.0a1
Bug 1260377 - Fix CDMProxy::SetServerCertificate crash since null pointer. r=cpearce
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