Bug 1270323: P5. Prevent potential null deref. r?cpearce
This currently can't happen as no MediaDataDecoder ever return a null sample.
MozReview-Commit-ID: BucIadubght
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1354,26 +1354,26 @@ MediaFormatReader::ResetDecode(TargetQue
}
}
return MediaDecoderReader::ResetDecode(aQueues);
}
void
MediaFormatReader::Output(TrackType aTrack, MediaData* aSample)
{
- LOGV("Decoded %s sample time=%lld timecode=%lld kf=%d dur=%lld",
- TrackTypeToStr(aTrack), aSample->mTime, aSample->mTimecode,
- aSample->mKeyframe, aSample->mDuration);
-
if (!aSample) {
NS_WARNING("MediaFormatReader::Output() passed a null sample");
Error(aTrack);
return;
}
+ LOGV("Decoded %s sample time=%lld timecode=%lld kf=%d dur=%lld",
+ TrackTypeToStr(aTrack), aSample->mTime, aSample->mTimecode,
+ aSample->mKeyframe, aSample->mDuration);
+
RefPtr<nsIRunnable> task =
NewRunnableMethod<TrackType, MediaData*>(
this, &MediaFormatReader::NotifyNewOutput, aTrack, aSample);
OwnerThread()->Dispatch(task.forget());
}
void
MediaFormatReader::DrainComplete(TrackType aTrack)