Bug 1141241 - Add nullcheck for mDecoder in WMFMediaDataDecoder::ProcessDrain(). r=mattwoodrow a=lmandel
authorChris Pearce <cpearce@mozilla.com>
Wed, 11 Mar 2015 22:01:19 +1300
changeset 250360 18ecbc81b0e4
parent 250359 19ac18d33c28
child 250361 f758eb029b69
push id4559
push usercpearce@mozilla.com
push date2015-03-12 04:24 +0000
treeherdermozilla-beta@18ecbc81b0e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, lmandel
bugs1141241
milestone37.0
Bug 1141241 - Add nullcheck for mDecoder in WMFMediaDataDecoder::ProcessDrain(). r=mattwoodrow a=lmandel
dom/media/fmp4/wmf/WMFMediaDataDecoder.cpp
--- a/dom/media/fmp4/wmf/WMFMediaDataDecoder.cpp
+++ b/dom/media/fmp4/wmf/WMFMediaDataDecoder.cpp
@@ -134,22 +134,24 @@ WMFMediaDataDecoder::Flush()
   NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE);
 
   return NS_OK;
 }
 
 void
 WMFMediaDataDecoder::ProcessDrain()
 {
-  // Order the decoder to drain...
-  if (FAILED(mDecoder->SendMFTMessage(MFT_MESSAGE_COMMAND_DRAIN, 0))) {
-    NS_WARNING("Failed to send DRAIN command to MFT");
+  if (mDecoder) {
+    // Order the decoder to drain...
+    if (FAILED(mDecoder->SendMFTMessage(MFT_MESSAGE_COMMAND_DRAIN, 0))) {
+      NS_WARNING("Failed to send DRAIN command to MFT");
+    }
+    // Then extract all available output.
+    ProcessOutput();
   }
-  // Then extract all available output.
-  ProcessOutput();
   mCallback->DrainComplete();
 }
 
 nsresult
 WMFMediaDataDecoder::Drain()
 {
   mTaskQueue->Dispatch(NS_NewRunnableMethod(this, &WMFMediaDataDecoder::ProcessDrain));
   return NS_OK;