Skip to content

Commit 3056840

Browse files
brendanlongwebkit-commit-queue
authored andcommitted
WebVTTParser's identifier buffering can ignore subsequent lines
https://bugs.webkit.org/show_bug.cgi?id=118483 Patch by Brendan Long <b.long@cablelabs.com> on 2013-07-24 Reviewed by Eric Carlson. No new tests since this bug can't be reproduced in layout tests. * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::parseBytes): Only buffer the identifier if we haven't read an entire line. Canonical link: https://commits.webkit.org/136877@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 0b014fa commit 3056840

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Source/WebCore/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2013-07-24 Brendan Long <b.long@cablelabs.com>
2+
3+
WebVTTParser's identifier buffering can ignore subsequent lines
4+
https://bugs.webkit.org/show_bug.cgi?id=118483
5+
6+
Reviewed by Eric Carlson.
7+
8+
No new tests since this bug can't be reproduced in layout tests.
9+
10+
* html/track/WebVTTParser.cpp:
11+
(WebCore::WebVTTParser::parseBytes): Only buffer the identifier if we haven't read an entire line.
12+
113
2013-07-23 Andreas Kling <akling@apple.com>
214

315
REGRESSION(r150867): FrameView auto-sizing + delegate denied image load may cause StyleResolver to re-enter itself.

Source/WebCore/html/track/WebVTTParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ void WebVTTParser::parseBytes(const char* data, unsigned length)
151151

152152
switch (m_state) {
153153
case Initial:
154-
// Buffer up at least 9 bytes before proceeding with checking for the file identifier.
154+
// Buffer up at least 9 bytes or a full line before proceeding with checking for the file identifier.
155155
m_identifierData.append(data, length);
156-
if (m_identifierData.size() < bomLength + fileIdentifierLength)
156+
if (position == line.sizeInBytes() && m_identifierData.size() < bomLength + fileIdentifierLength)
157157
return;
158158

159159
// 4-12 - Collect the first line and check for "WEBVTT".

0 commit comments

Comments
 (0)