Bug 1111387 - Nullcheck mTaskQueue in TrackBuffer::QueueInitializeDecoder, as we can shutdown in between dispatching and running the task that calls QueueInitializeDecoder. r=cajbir, a=sledru
authorChris Pearce <cpearce@mozilla.com>
Mon, 15 Dec 2014 15:30:20 +1300
changeset 242753 f1ce42d25781e10a5ea3b636d391495de978d872
parent 242752 aeb375511a296602149bf7d2aaa2e389d4842f3a
child 242754 5a2808b6675bf3d24646a72172e1e0801a70a8ca
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir, sledru
bugs1111387
milestone36.0a2
Bug 1111387 - Nullcheck mTaskQueue in TrackBuffer::QueueInitializeDecoder, as we can shutdown in between dispatching and running the task that calls QueueInitializeDecoder. r=cajbir, a=sledru
dom/media/mediasource/TrackBuffer.cpp
--- a/dom/media/mediasource/TrackBuffer.cpp
+++ b/dom/media/mediasource/TrackBuffer.cpp
@@ -343,16 +343,20 @@ TrackBuffer::NewDecoder()
 
   decoder->SetTaskQueue(mTaskQueue);
   return decoder.forget();
 }
 
 bool
 TrackBuffer::QueueInitializeDecoder(SourceBufferDecoder* aDecoder)
 {
+  if (NS_WARN_IF(!mTaskQueue)) {
+    return false;
+  }
+
   RefPtr<nsIRunnable> task =
     NS_NewRunnableMethodWithArg<SourceBufferDecoder*>(this,
                                                       &TrackBuffer::InitializeDecoder,
                                                       aDecoder);
   if (NS_FAILED(mTaskQueue->Dispatch(task))) {
     MSE_DEBUG("MediaSourceReader(%p): Failed to enqueue decoder initialization task", this);
     RemoveDecoder(aDecoder);
     return false;