Bug 943729 - Crash in TimeRanges::TimeRange, r=giles

This commit is contained in:
Olli Pettay 2013-12-03 09:22:37 +02:00
parent 75eb0073f7
commit 83be9793bf

View File

@ -1320,6 +1320,12 @@ HTMLMediaElement::SetCurrentTime(double aCurrentTime, ErrorResult& aRv)
return;
}
if (!mPlayed) {
LOG(PR_LOG_DEBUG, ("HTMLMediaElement::mPlayed not available."));
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
if (mCurrentPlayRangeStart != -1.0) {
double rangeEndTime = CurrentTime();
LOG(PR_LOG_DEBUG, ("%p Adding \'played\' a range : [%f, %f]", this, mCurrentPlayRangeStart, rangeEndTime));
@ -1427,7 +1433,9 @@ HTMLMediaElement::Played()
nsRefPtr<TimeRanges> ranges = new TimeRanges();
uint32_t timeRangeCount = 0;
mPlayed->GetLength(&timeRangeCount);
if (mPlayed) {
mPlayed->GetLength(&timeRangeCount);
}
for (uint32_t i = 0; i < timeRangeCount; i++) {
double begin;
double end;