[FFmpeg-devel] [PATCH] avformat/webvttdec: improve WebVTT parsing

Marcos Del Sol marcos at orca.pet
Tue Jun 10 02:51:04 EEST 2025


> The linked file does not follow the syntax specified in section 4 of
> the WebVTT standard. Therefore it is not WebVTT.

The section 6.1 on file parsing, says explicitely that processing should
be aborted if, and only if:

 - The file is too small (point 4)
 - The file does not start with "WEBVTT" (point 5)
 - The character after "WEBVTT" is not a whitespace (point 6)
 - There is no data after "WEBVTT" (point 8 and 10)

Note on the point 14, the main block handling loop, it not even once talks
about aborting parsing. If an extraneous block is found, no action should
be taken. It is just ignored and keeps processing the next ones.

WebVTT is supposed to be an extensible format. Limiting to a small set of
known values and silently aborting when anything new is introduced does
not seem like the best option to me. Web browsers do not stop rendering
pages when they see a new, unknown HTML tag or CSS option.


More information about the ffmpeg-devel mailing list