Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Stebbins <jstebbins@jetheaddev.com>2020-04-04 22:17:33 +0300
committerPhilip Langdale <philipl@overt.org>2020-04-10 19:32:13 +0300
commita52eef68d4ba4b7166b8a7681e1a8812c2866823 (patch)
treef2481d9a7a5382df42584169632dd5d6a96d2685 /libavcodec/ass_split.c
parentb8d4a66b29b1dc3f6f48ce85577bfb6b57bd338f (diff)
lavc/ass_split: fix parsing utf8 scripts
The [Script Info] section was skipped if starts with UTF8 BOM Signed-off-by: Philip Langdale <philipl@overt.org>
Diffstat (limited to 'libavcodec/ass_split.c')
-rw-r--r--libavcodec/ass_split.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c
index 67da7c6d84..c2c388d9f0 100644
--- a/libavcodec/ass_split.c
+++ b/libavcodec/ass_split.c
@@ -376,6 +376,8 @@ ASSSplitContext *ff_ass_split(const char *buf)
ASSSplitContext *ctx = av_mallocz(sizeof(*ctx));
if (!ctx)
return NULL;
+ if (buf && !memcmp(buf, "\xef\xbb\xbf", 3)) // Skip UTF-8 BOM header
+ buf += 3;
ctx->current_section = -1;
if (ass_split(ctx, buf) < 0) {
ff_ass_split_free(ctx);