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

This commit is contained in:
Olli Pettay 2013-12-03 09:22:37 +02:00
Родитель 75eb0073f7
Коммит 83be9793bf
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

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