Bug 1116626 - Null check mDecoder in AutoNotifyDecoded since it might have been shutdown already. r=karlt, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 12 Jan 2015 09:41:50 +1300
changeset 242847 e076d58d5b10
parent 242846 1d406b3f20db
child 242848 2fd2c6de0a87
push id4321
push userryanvm@gmail.com
push date2015-01-14 15:04 +0000
treeherdermozilla-beta@a78eb4dd84f0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, sledru
bugs1116626
milestone36.0
Bug 1116626 - Null check mDecoder in AutoNotifyDecoded since it might have been shutdown already. r=karlt, a=sledru
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