Skip to content

Commit

Permalink
Fixed appendUntilEventFires to stop at the end of media segments
Browse files Browse the repository at this point in the history
User agents may prioritize appending media segments over the underlying
operation and expected event that the function is waiting for. The method
could crash when it reached the end of available media segments to add.
  • Loading branch information
tidoust committed Jul 12, 2016
1 parent 4d97840 commit b738c3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion media-source/mediasource-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@

var i = startingIndex;
var onAppendDone = function() {
if (eventFired)
if (eventFired || (i >= (segmentInfo.media.length - 1)))
return;

i++;
Expand Down

0 comments on commit b738c3e

Please sign in to comment.