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 249588 0d5c5aa97c0797cc661c0925ff99891215452a73
parent 249587 6e965acecbe6cc8ac285bd1588781b912b6c56a2
child 249589 02448988e634dd78e8617fd3ab865d99657c7358
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, lmandel
bugs1128179
milestone37.0a2
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;
       }