[FFmpeg-devel] [PATCH 3/3] lavf/subtitles: Unfix ticket #5032

Tomas Härdin git at haerdin.se
Fri Mar 29 01:06:36 EET 2024


Obviously the most controversial patch in this set. I'd like to know
what program exactly that produced the broken file in ticket #5032 so
that we can send the guilty party to parsing jail

More seriously, eating any run of CR CR CR... is incredibly broken and
is part of the reason for the convoluted parsing logic in srtdec before
this patchset. A compromise solution could be to peek two bytes forward
and see if the line ending is CR CR LF. My guess is the file was
produced by running unix2dos on a file with CR LF, thus converting the
LF to CR LF.

webvttdec is better with this, probably because these kinds of line
ending is explicitly banned by the WebVTT spec. That is, CR CR LF is to
be treated as two line endings, no ifs or buts about it.

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-lavf-subtitles-Unfix-ticket-5032.patch
Type: text/x-patch
Size: 1953 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240329/5c26bd94/attachment.bin>


More information about the ffmpeg-devel mailing list