mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-10 00:40:01 +01:00
avformat/srtdec: skip initial random line breaks.
I found a bunch of (recent) SRT files in the wild with 3 to 10 line
breaks at the beginning.
(cherry picked from commit cfcd55db16)
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
This commit is contained in:
committed by
Alexander Strasser
parent
b4f90013ab
commit
a0779a2ee5
@@ -37,6 +37,8 @@ static int srt_probe(AVProbeData *p)
|
||||
if (AV_RB24(ptr) == 0xEFBBBF)
|
||||
ptr += 3; /* skip UTF-8 BOM */
|
||||
|
||||
while (*ptr == '\r' || *ptr == '\n')
|
||||
ptr++;
|
||||
for (i=0; i<2; i++) {
|
||||
if ((num == i || num + 1 == i)
|
||||
&& sscanf(ptr, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
|
||||
|
||||
Reference in New Issue
Block a user