Bug 1132757 - Don't crash if we call WMFVideoMFTManager after we've initiated shutdown. r=cpearce, a=lsblakk
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 27 Feb 2015 11:46:10 +1300
changeset 250096 2aa1ca037446
parent 250095 7ede0abc5a1c
child 250097 4b6bec5f7ff7
push id4501
push userryanvm@gmail.com
push date2015-02-27 20:57 +0000
treeherdermozilla-beta@2aa1ca037446 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, lsblakk
bugs1132757
milestone37.0
Bug 1132757 - Don't crash if we call WMFVideoMFTManager after we've initiated shutdown. r=cpearce, a=lsblakk
dom/media/fmp4/wmf/WMFVideoMFTManager.cpp
--- a/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/fmp4/wmf/WMFVideoMFTManager.cpp
@@ -229,16 +229,20 @@ WMFVideoMFTManager::Init()
   LOG("Video Decoder initialized, Using DXVA: %s", (mUseHwAccel ? "Yes" : "No"));
 
   return decoder.forget();
 }
 
 HRESULT
 WMFVideoMFTManager::Input(mp4_demuxer::MP4Sample* aSample)
 {
+  if (!mDecoder) {
+    // This can happen during shutdown.
+    return E_FAIL;
+  }
   if (mStreamType != VP8 && mStreamType != VP9) {
     // We must prepare samples in AVC Annex B.
     if (!mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample)) {
       return E_FAIL;
     }
   }
   // Forward sample data to the decoder.
   const uint8_t* data = reinterpret_cast<const uint8_t*>(aSample->data);