Bug 1055907 - Delete output sent to MP4Reader while it's flushing, prevents leaks. r=kentuckyfriedtakahe
authorChris Pearce <cpearce@mozilla.com>
Thu, 21 Aug 2014 16:10:57 +1200
changeset 200752 a4200559a648a1e2a6d67dd6a18cfa80e12a035b
parent 200751 8c5f7a39a59a9c4e330d2a8727cc2afe1ee0256c
child 200753 7a6008e82204cb0221305eb0bb38215c34e72a32
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerskentuckyfriedtakahe
bugs1055907
milestone34.0a1
Bug 1055907 - Delete output sent to MP4Reader while it's flushing, prevents leaks. r=kentuckyfriedtakahe
content/media/fmp4/MP4Reader.cpp
--- a/content/media/fmp4/MP4Reader.cpp
+++ b/content/media/fmp4/MP4Reader.cpp
@@ -591,16 +591,18 @@ MP4Reader::Output(TrackType aTrack, Medi
   LOG("Decoded %s sample time=%lld dur=%lld",
       TrackTypeToStr(aTrack), aSample->mTime, aSample->mDuration);
 #endif
 
   DecoderData& data = GetDecoderData(aTrack);
   // Don't accept output while we're flushing.
   MonitorAutoLock mon(data.mMonitor);
   if (data.mIsFlushing) {
+    delete aSample;
+    LOG("MP4Reader produced output while flushing, discarding.");
     mon.NotifyAll();
     return;
   }
 
   switch (aTrack) {
     case kAudio: {
       MOZ_ASSERT(aSample->mType == MediaData::AUDIO_SAMPLES);
       AudioData* audioData = static_cast<AudioData*>(aSample);