Bug 1116626 - Null check mDecoder in AutoNotifyDecoded since it might have been shutdown already. r=karlt
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 12 Jan 2015 09:41:50 +1300
changeset 223156 0aaec62e668467cc9e90e6959c3feccfcf0652bc
parent 223155 238f460e7aedc87a4ce3fdff8b9479256d3f3d58
child 223157 c9177ec839af085abfe9390c947e1a277a3a5e80
push id28082
push usercbook@mozilla.com
push dateMon, 12 Jan 2015 10:44:52 +0000
treeherdermozilla-central@643589c3ef94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1116626
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1116626 - Null check mDecoder in AutoNotifyDecoded since it might have been shutdown already. r=karlt
dom/media/AbstractMediaDecoder.h
--- a/dom/media/AbstractMediaDecoder.h
+++ b/dom/media/AbstractMediaDecoder.h
@@ -138,17 +138,19 @@ public:
   // Stack based class to assist in notifying the frame statistics of
   // parsed and decoded frames. Use inside video demux & decode functions
   // to ensure all parsed and decoded frames are reported on all return paths.
   class AutoNotifyDecoded {
   public:
     AutoNotifyDecoded(AbstractMediaDecoder* aDecoder, uint32_t& aParsed, uint32_t& aDecoded)
       : mDecoder(aDecoder), mParsed(aParsed), mDecoded(aDecoded) {}
     ~AutoNotifyDecoded() {
-      mDecoder->NotifyDecodedFrames(mParsed, mDecoded);
+      if (mDecoder) {
+        mDecoder->NotifyDecodedFrames(mParsed, mDecoded);
+      }
     }
   private:
     AbstractMediaDecoder* mDecoder;
     uint32_t& mParsed;
     uint32_t& mDecoded;
   };
 
 #ifdef MOZ_EME