[FFmpeg-devel] [PATCH] avformat/webvttdec: skip STYLE blocks

Stephan Hohe sth.dev at tejp.de
Tue Sep 7 18:38:40 EEST 2021


Parsing STYLE blocks as normal subtitle data doesn't work, so
instead skip those blocks completely.

Fixes #9064
---
 libavformat/webvttdec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index 52320ba7d1..40763b082d 100644
--- a/libavformat/webvttdec.c
+++ b/libavformat/webvttdec.c
@@ -114,6 +114,11 @@ static int webvtt_read_header(AVFormatContext *s)
                 p++;
         }
 
+        /* skip STYLE blocks */
+        if (identifier_len == 5 && !strncmp(identifier, "STYLE", 5)) {
+            continue;
+        }
+
         /* cue timestamps */
         if ((ts_start = read_ts(p)) == AV_NOPTS_VALUE)
             break;
-- 
2.30.2



More information about the ffmpeg-devel mailing list