Bug 1293613: Never attempt to read past end of manifest table. r=gerald

Should the events being waited for take a while to fire, we could have attempted to append more segments than the table contain causing an exception.

MozReview-Commit-ID: HnmLTqNQ5rb

--HG--
extra : rebase_source : f9b703a0ed1f3b950428dc55dd7943068bc6aa2d
This commit is contained in:
Jean-Yves Avenard 2016-08-11 15:17:34 +10:00
Родитель 9a05e8296e
Коммит 72149ae3fe
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -305,7 +305,10 @@
return;
i++;
MediaSourceUtil.append(test, sourceBuffer, MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[i]), onAppendDone);
if (i < segmentInfo.media.length)
{
MediaSourceUtil.append(test, sourceBuffer, MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[i]), onAppendDone);
}
};
MediaSourceUtil.append(test, sourceBuffer, MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.media[i]), onAppendDone);