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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3aa5a532
2013-07-24 Brendan Long <b.long@cablelabs.com>
WebVTTParser's identifier buffering can ignore subsequent lines
https://bugs.webkit.org/show_bug.cgi?id=118483
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.
2013-07-23 Andreas Kling <akling@apple.com>
REGRESSION(r150867): FrameView auto-sizing + delegate denied image load may cause StyleResolver to re-enter itself.
......@@ -151,9 +151,9 @@ void WebVTTParser::parseBytes(const char* data, unsigned length)
switch (m_state) {
case Initial:
// Buffer up at least 9 bytes before proceeding with checking for the file identifier.
// Buffer up at least 9 bytes or a full line before proceeding with checking for the file identifier.
m_identifierData.append(data, length);
if (m_identifierData.size() < bomLength + fileIdentifierLength)
if (position == line.sizeInBytes() && m_identifierData.size() < bomLength + fileIdentifierLength)
return;
// 4-12 - Collect the first line and check for "WEBVTT".
......
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