Bug 1128179 - Avoiding crash when appending data after decoder initialization failed. r=jya, a=lmandel
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 03 Feb 2015 09:44:46 +1300
changeset 243696 a5992bd7d600
parent 243695 4155bf349dbb
child 243697 9b1ff4e3ca58
push id4440
push userryanvm@gmail.com
push date2015-02-05 16:07 +0000
treeherdermozilla-beta@74c4e5bdde78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, lmandel
bugs1128179
milestone36.0
Bug 1128179 - Avoiding crash when appending data after decoder initialization failed. r=jya, a=lmandel
dom/media/mediasource/TrackBuffer.cpp
--- a/dom/media/mediasource/TrackBuffer.cpp
+++ b/dom/media/mediasource/TrackBuffer.cpp
@@ -163,17 +163,17 @@ TrackBuffer::AppendData(LargeDataBuffer*
   int64_t start, end;
   if (mParser->ParseStartAndEndTimestamps(aData, start, end)) {
     start += aTimestampOffset;
     end += aTimestampOffset;
     if (mParser->IsMediaSegmentPresent(aData) &&
         mLastEndTimestamp &&
         (!mParser->TimestampsFuzzyEqual(start, mLastEndTimestamp.value()) ||
          mLastTimestampOffset != aTimestampOffset ||
-         mDecoderPerSegment || mCurrentDecoder->WasTrimmed())) {
+         mDecoderPerSegment || (mCurrentDecoder && mCurrentDecoder->WasTrimmed()))) {
       MSE_DEBUG("TrackBuffer(%p)::AppendData: Data last=[%lld, %lld] overlaps [%lld, %lld]",
                 this, mLastStartTimestamp, mLastEndTimestamp.value(), start, end);
 
       // This data is earlier in the timeline than data we have already
       // processed, so we must create a new decoder to handle the decoding.
       if (!decoders.NewDecoder(aTimestampOffset)) {
         return false;
       }