Changeset 99039 in webkit


Ignore:
Timestamp:
Nov 1, 2011 10:48:12 PM (12 years ago)
Author:
annacc@chromium.org
Message:

Small fixes for WebVTTParser.
https://bugs.webkit.org/show_bug.cgi?id=71334

Reviewed by Darin Adler.

No new tests. This is needed to enable other tests, coming soon.

  • html/track/WebVTTParser.cpp:

(WebCore::hasLongWebVTTIdentifier): changed to return true when header is

exactly "WEBVTT"

(WebCore::WebVTTParser::collectTimingsAndSettings): fix typos, position should

only progress once when checking the character after a timestamp.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r99035 r99039  
     12011-11-01  Anna Cavender  <annacc@chromium.org>
     2
     3        Small fixes for WebVTTParser.
     4        https://bugs.webkit.org/show_bug.cgi?id=71334
     5
     6        Reviewed by Darin Adler.
     7
     8        No new tests.  This is needed to enable other tests, coming soon.
     9
     10        * html/track/WebVTTParser.cpp:
     11        (WebCore::hasLongWebVTTIdentifier): changed to return true when header is
     12            exactly "WEBVTT"
     13        (WebCore::WebVTTParser::collectTimingsAndSettings): fix typos, position should
     14            only progress once when checking the character after a timestamp.
     15
    1162011-11-01  Darin Adler  <darin@apple.com>
    217
  • trunk/Source/WebCore/html/track/WebVTTParser.cpp

    r97883 r99039  
    6565
    6666    // or the seventh character is neither a space nor a tab character, then abort.
    67     if (line[fileIdentiferLength] != ' ' && line[fileIdentiferLength] != '\t')
     67    if (line.length() > fileIdentiferLength && line[fileIdentiferLength] != ' ' && line[fileIdentiferLength] != '\t')
    6868        return false;
    6969
     
    191191    if (m_currentStartTime == malformedTime)
    192192        return BadCue;
    193     if (line[position++] != ' ' && line[position++] != '\t')
     193    if (position >= line.length())
     194        return BadCue;
     195    char nextChar = line[position++];
     196    if (nextChar != ' ' && nextChar != '\t')
    194197        return BadCue;
    195198    skipWhiteSpace(line, &position);
     
    199202        return BadCue;
    200203    position += 3;
    201     if (line[position++] != ' ' && line[position++] != '\t')
     204    if (position >= line.length())
     205        return BadCue;
     206    nextChar = line[position++];
     207    if (nextChar != ' ' && nextChar != '\t')
    202208        return BadCue;
    203209    skipWhiteSpace(line, &position);
Note: See TracChangeset for help on using the changeset viewer.