Index: Source/WebCore/html/track/TextTrackCueList.cpp |
=================================================================== |
--- Source/WebCore/html/track/TextTrackCueList.cpp (revision 134273) |
+++ Source/WebCore/html/track/TextTrackCueList.cpp (working copy) |
@@ -92,12 +92,12 @@ |
// http://www.whatwg.org/specs/web-apps/current-work/#text-track-cue-order |
RefPtr<TextTrackCue> cue = prpCue; |
if (start == end) { |
- if (!m_list.isEmpty() && (m_list[start - 1].get() == cue.get())) |
+ if (!m_list.isEmpty() && (start > 0) && (m_list[start - 1].get() == cue.get())) |
return false; |
- m_list.insert(start, cue); |
- invalidateCueIndexes(start); |
- return true; |
+ m_list.insert(start, cue); |
+ invalidateCueIndexes(start); |
+ return true; |
} |
size_t index = (start + end) / 2; |