Fix TextTrackCue::cueIndex() to handle the null case of TextTrack::cues(() properly

https://bugs.webkit.org/show_bug.cgi?id=117815
<rdar://problem/14211041>

Patch by Ruth Fong <ruth_fong@apple.com> on 2013-07-08
Reviewed by Eric Carlson.

Merge https://src.chromium.org/viewvc/blink?revision=153206&view=revision

No new tests, only behavior change is preventing a crash in the release build.
cueIndex() is only used for sorting cues, so returning an invalidCueIndex in the case
where track()->cues() is null makes sense and won't modify behavior.

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::cueIndex):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0eaea807
2013-07-08 Ruth Fong <ruth_fong@apple.com>
Fix TextTrackCue::cueIndex() to handle the null case of TextTrack::cues(() properly
https://bugs.webkit.org/show_bug.cgi?id=117815
<rdar://problem/14211041>
Reviewed by Eric Carlson.
Merge https://src.chromium.org/viewvc/blink?revision=153206&view=revision
No new tests, only behavior change is preventing a crash in the release build.
cueIndex() is only used for sorting cues, so returning an invalidCueIndex in the case
where track()->cues() is null makes sense and won't modify behavior.
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::cueIndex):
2013-07-08 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r152416.
......@@ -486,7 +486,8 @@ int TextTrackCue::cueIndex()
if (m_cueIndex == invalidCueIndex) {
ASSERT(track());
ASSERT(track()->cues());
m_cueIndex = track()->cues()->getCueIndex(this);
if (TextTrackCueList* cueList = track()->cues())
m_cueIndex = cueList->getCueIndex(this);
}
return m_cueIndex;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment